diff --git a/.idea/modules.xml b/.idea/modules.xml index 702ef3a..816278b 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,6 +3,7 @@ + diff --git a/LLapp b/LLapp new file mode 160000 index 0000000..fdd9265 --- /dev/null +++ b/LLapp @@ -0,0 +1 @@ +Subproject commit fdd92652be76f6818cdd379d506fb093eea0b232 diff --git a/LLapp-master/.idea/compiler.xml b/LLapp-master/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/LLapp-master/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LLapp-master/.idea/copyright/profiles_settings.xml b/LLapp-master/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/LLapp-master/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/LLapp-master/.idea/gradle.xml b/LLapp-master/.idea/gradle.xml new file mode 100644 index 0000000..47bd81f --- /dev/null +++ b/LLapp-master/.idea/gradle.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/LLapp-master/.idea/misc.xml b/LLapp-master/.idea/misc.xml new file mode 100644 index 0000000..297d212 --- /dev/null +++ b/LLapp-master/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/LLapp-master/.idea/modules.xml b/LLapp-master/.idea/modules.xml new file mode 100644 index 0000000..609b5bd --- /dev/null +++ b/LLapp-master/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/LLapp-master/.idea/workspace.xml b/LLapp-master/.idea/workspace.xml new file mode 100644 index 0000000..e205455 --- /dev/null +++ b/LLapp-master/.idea/workspace.xml @@ -0,0 +1,771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1488933428129 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LLapp-master/gradle/wrapper/gradle-wrapper.jar b/LLapp-master/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..13372ae Binary files /dev/null and b/LLapp-master/gradle/wrapper/gradle-wrapper.jar differ diff --git a/LLapp-master/gradle/wrapper/gradle-wrapper.properties b/LLapp-master/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..04e285f --- /dev/null +++ b/LLapp-master/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Dec 28 10:00:20 PST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/LLapp-master/gradlew b/LLapp-master/gradlew new file mode 100644 index 0000000..9d82f78 --- /dev/null +++ b/LLapp-master/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/LLapp-master/gradlew.bat b/LLapp-master/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/LLapp-master/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/LLapp-master/local.properties b/LLapp-master/local.properties new file mode 100644 index 0000000..6ae3476 --- /dev/null +++ b/LLapp-master/local.properties @@ -0,0 +1,11 @@ +## This file is automatically generated by Android Studio. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Sat Mar 25 15:05:30 GMT 2017 +sdk.dir=C\:\\Users\\Dragos\\AppData\\Local\\Android\\Sdk diff --git a/Llapp_latest_version/.gitattributes b/Llapp_latest_version/.gitattributes new file mode 100644 index 0000000..bdb0cab --- /dev/null +++ b/Llapp_latest_version/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/Llapp_latest_version/.gitignore b/Llapp_latest_version/.gitignore new file mode 100644 index 0000000..39fb081 --- /dev/null +++ b/Llapp_latest_version/.gitignore @@ -0,0 +1,9 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/Llapp_latest_version/.idea/compiler.xml b/Llapp_latest_version/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/Llapp_latest_version/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Llapp_latest_version/.idea/copyright/profiles_settings.xml b/Llapp_latest_version/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/Llapp_latest_version/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Llapp_latest_version/.idea/gradle.xml b/Llapp_latest_version/.idea/gradle.xml new file mode 100644 index 0000000..7ac24c7 --- /dev/null +++ b/Llapp_latest_version/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/Llapp_latest_version/.idea/inspectionProfiles/Project_Default.xml b/Llapp_latest_version/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..d5b2209 --- /dev/null +++ b/Llapp_latest_version/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/Llapp_latest_version/.idea/inspectionProfiles/profiles_settings.xml b/Llapp_latest_version/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..3b31283 --- /dev/null +++ b/Llapp_latest_version/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/Llapp_latest_version/.idea/misc.xml b/Llapp_latest_version/.idea/misc.xml new file mode 100644 index 0000000..5d19981 --- /dev/null +++ b/Llapp_latest_version/.idea/misc.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Llapp_latest_version/.idea/modules.xml b/Llapp_latest_version/.idea/modules.xml new file mode 100644 index 0000000..e5fad2d --- /dev/null +++ b/Llapp_latest_version/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Llapp_latest_version/.idea/runConfigurations.xml b/Llapp_latest_version/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/Llapp_latest_version/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/Llapp_latest_version/.idea/vcs.xml similarity index 100% rename from .idea/vcs.xml rename to Llapp_latest_version/.idea/vcs.xml diff --git a/Llapp_latest_version/LLapp-master/.idea/compiler.xml b/Llapp_latest_version/LLapp-master/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/Llapp_latest_version/LLapp-master/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Llapp_latest_version/LLapp-master/.idea/copyright/profiles_settings.xml b/Llapp_latest_version/LLapp-master/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/Llapp_latest_version/LLapp-master/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Llapp_latest_version/LLapp-master/.idea/misc.xml b/Llapp_latest_version/LLapp-master/.idea/misc.xml new file mode 100644 index 0000000..297d212 --- /dev/null +++ b/Llapp_latest_version/LLapp-master/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Llapp_latest_version/LLapp-master/.idea/workspace.xml b/Llapp_latest_version/LLapp-master/.idea/workspace.xml new file mode 100644 index 0000000..834f11d --- /dev/null +++ b/Llapp_latest_version/LLapp-master/.idea/workspace.xml @@ -0,0 +1,524 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1488933428129 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Llapp_latest_version/app/.gitignore b/Llapp_latest_version/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/Llapp_latest_version/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/Llapp_latest_version/app/build.gradle b/Llapp_latest_version/app/build.gradle new file mode 100644 index 0000000..0e2d2e1 --- /dev/null +++ b/Llapp_latest_version/app/build.gradle @@ -0,0 +1,36 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 25 + buildToolsVersion "25.0.2" + defaultConfig { + applicationId "georgia.languagelandscape" + minSdkVersion 15 + targetSdkVersion 25 + versionCode 1 + versionName "1.0" + multiDexEnabled true + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(include: ['*.jar'], dir: 'libs') + compile 'com.android.volley:volley:1.0.0' + androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + exclude group: 'com.android.support', module: 'support-annotations' + }) + compile 'com.android.support:appcompat-v7:25.1.1' + compile 'com.google.android.gms:play-services:10.2.0' + compile 'com.android.support:design:25.1.1' + compile 'com.github.bumptech.glide:glide:3.7.0' + compile 'com.android.support:support-v4:25.1.1' + compile 'com.google.code.gson:gson:2.6.2' + testCompile 'junit:junit:4.12' +} diff --git a/Llapp_latest_version/app/proguard-rules.pro b/Llapp_latest_version/app/proguard-rules.pro new file mode 100644 index 0000000..4a53664 --- /dev/null +++ b/Llapp_latest_version/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 C:\Users\Georgia\AppData\Local\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/Llapp_latest_version/app/src/androidTest/java/georgia/languagelandscape/ExampleInstrumentedTest.java b/Llapp_latest_version/app/src/androidTest/java/georgia/languagelandscape/ExampleInstrumentedTest.java new file mode 100644 index 0000000..7662f69 --- /dev/null +++ b/Llapp_latest_version/app/src/androidTest/java/georgia/languagelandscape/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package georgia.languagelandscape; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumentation test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() throws Exception { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("georgia.languagelandscape", appContext.getPackageName()); + } +} diff --git a/Llapp_latest_version/app/src/main/AndroidManifest.xml b/Llapp_latest_version/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..06baf3e --- /dev/null +++ b/Llapp_latest_version/app/src/main/AndroidManifest.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Llapp_latest_version/app/src/main/ic_add_project-web.png b/Llapp_latest_version/app/src/main/ic_add_project-web.png new file mode 100644 index 0000000..b6ed11c Binary files /dev/null and b/Llapp_latest_version/app/src/main/ic_add_project-web.png differ diff --git a/Llapp_latest_version/app/src/main/ic_browse_the_map-web.png b/Llapp_latest_version/app/src/main/ic_browse_the_map-web.png new file mode 100644 index 0000000..98510a7 Binary files /dev/null and b/Llapp_latest_version/app/src/main/ic_browse_the_map-web.png differ diff --git a/Llapp_latest_version/app/src/main/ic_feed-web.png b/Llapp_latest_version/app/src/main/ic_feed-web.png new file mode 100644 index 0000000..3b9940e Binary files /dev/null and b/Llapp_latest_version/app/src/main/ic_feed-web.png differ diff --git a/Llapp_latest_version/app/src/main/ic_log_out-web.png b/Llapp_latest_version/app/src/main/ic_log_out-web.png new file mode 100644 index 0000000..0efa3b6 Binary files /dev/null and b/Llapp_latest_version/app/src/main/ic_log_out-web.png differ diff --git a/Llapp_latest_version/app/src/main/ic_menu_feed-web.png b/Llapp_latest_version/app/src/main/ic_menu_feed-web.png new file mode 100644 index 0000000..dfba8f1 Binary files /dev/null and b/Llapp_latest_version/app/src/main/ic_menu_feed-web.png differ diff --git a/Llapp_latest_version/app/src/main/ic_my_profile-web.png b/Llapp_latest_version/app/src/main/ic_my_profile-web.png new file mode 100644 index 0000000..3349767 Binary files /dev/null and b/Llapp_latest_version/app/src/main/ic_my_profile-web.png differ diff --git a/Llapp_latest_version/app/src/main/ic_my_projects-web.png b/Llapp_latest_version/app/src/main/ic_my_projects-web.png new file mode 100644 index 0000000..93a8d08 Binary files /dev/null and b/Llapp_latest_version/app/src/main/ic_my_projects-web.png differ diff --git a/Llapp_latest_version/app/src/main/ic_new_project-web.png b/Llapp_latest_version/app/src/main/ic_new_project-web.png new file mode 100644 index 0000000..b6ed11c Binary files /dev/null and b/Llapp_latest_version/app/src/main/ic_new_project-web.png differ diff --git a/Llapp_latest_version/app/src/main/ic_new_projects-web.png b/Llapp_latest_version/app/src/main/ic_new_projects-web.png new file mode 100644 index 0000000..b6ed11c Binary files /dev/null and b/Llapp_latest_version/app/src/main/ic_new_projects-web.png differ diff --git a/Llapp_latest_version/app/src/main/ic_recording-web.png b/Llapp_latest_version/app/src/main/ic_recording-web.png new file mode 100644 index 0000000..7118fe2 Binary files /dev/null and b/Llapp_latest_version/app/src/main/ic_recording-web.png differ diff --git a/Llapp_latest_version/app/src/main/ic_settings-web.png b/Llapp_latest_version/app/src/main/ic_settings-web.png new file mode 100644 index 0000000..25f0c86 Binary files /dev/null and b/Llapp_latest_version/app/src/main/ic_settings-web.png differ diff --git a/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/BaseActivity.java b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/BaseActivity.java new file mode 100644 index 0000000..e965b5c --- /dev/null +++ b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/BaseActivity.java @@ -0,0 +1,160 @@ +package georgia.languagelandscape; + +import android.content.Intent; +import android.content.res.Configuration; +import android.net.Uri; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.design.widget.NavigationView; +import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentTransaction; +import android.support.v4.view.GravityCompat; +import android.support.v4.widget.DrawerLayout; +import android.support.v7.app.ActionBarDrawerToggle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.Menu; +import android.view.MenuItem; + +public class BaseActivity extends AppCompatActivity + implements NavigationView.OnNavigationItemSelectedListener, + ProfileFragment.OnFragmentInteractionListener, + MyProjectsFragment.OnFragmentInteractionListener , + NewProjectFragment.OnFragmentInteractionListener{ + + private ActionBarDrawerToggle toggle = null; + private DrawerLayout drawer = null; + + protected void onDrawerCreated() { + + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + toggle = new ActionBarDrawerToggle( + this, + drawer, + toolbar, + R.string.navigation_drawer_open, + R.string.navigation_drawer_close); + drawer.addDrawerListener(toggle); + toggle.syncState(); + + NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); + navigationView.setNavigationItemSelectedListener(this); + navigationView.setItemIconTintList(null); + } + + @Override + public void onBackPressed() { + DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + if (drawer.isDrawerOpen(GravityCompat.START)) { + drawer.closeDrawer(GravityCompat.START); + } else { + super.onBackPressed(); + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.navigation_drawer, 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 + protected void onPostCreate(@Nullable Bundle savedInstanceState) { + super.onPostCreate(savedInstanceState); + toggle.syncState(); + } + + @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + toggle.onConfigurationChanged(newConfig); + } + + @Override + public boolean onNavigationItemSelected(MenuItem item) { + // Handle navigation view item clicks here. + int id = item.getItemId(); + FragmentManager fm = getSupportFragmentManager(); + FragmentTransaction ft = fm.beginTransaction(); + Intent myIntent; + + + switch (id) { + case R.id.nav_log_out: + myIntent = new Intent(BaseActivity.this, MainActivity.class); + drawer.closeDrawer(GravityCompat.START); + startActivity(myIntent); + finish(); + break; + case R.id.nav_browse_the_map: + if (!MapActivity.isActive()) { + myIntent = new Intent(BaseActivity.this, MapActivity.class); + drawer.closeDrawer(GravityCompat.START); + startActivity(myIntent); + finish(); + } else { + MapFragment mapFragment = new MapFragment(); + Bundle bundle = new Bundle(); + bundle.putDouble(MapActivity.GEO_LONGITUDE, MapActivity.getLongitude()); + bundle.putDouble(MapActivity.GEO_LATITUDE, MapActivity.getLatitude()); + mapFragment.setArguments(bundle); + ft.replace(R.id.content_replace, mapFragment); + } + break; + case R.id.nav_feed: + // TODO: go to all recordings page + break; + case R.id.nav_my_profile: + myIntent = new Intent(BaseActivity.this, MapActivity.class); + myIntent.putExtra(MapActivity.FRAGMENT_ID, MapActivity.FRAG_PROFILE); + startActivity(myIntent); + finish(); + break; + case R.id.nav_new_project: + myIntent = new Intent(BaseActivity.this, MapActivity.class); + myIntent.putExtra(MapActivity.FRAGMENT_ID, MapActivity.FRAG_NEW_PROJECT); + startActivity(myIntent); + finish(); + break; + case R.id.nav_my_projects: + myIntent = new Intent(BaseActivity.this, MapActivity.class); + myIntent.putExtra(MapActivity.FRAGMENT_ID, MapActivity.FRAG_MY_PROJECT); + startActivity(myIntent); + finish(); + break; + case R.id.nav_seetings: + // TODO: go to setting page + break; + case R.id.nav_my_recordings: + // TODO: go to myrecording page + break; + } + + ft.commit(); + drawer.closeDrawer(GravityCompat.START); + return true; + } + + @Override + public void onFragmentInteraction(Uri uri) { + } + +} diff --git a/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MainActivity.java b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MainActivity.java new file mode 100644 index 0000000..a30f7e7 --- /dev/null +++ b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MainActivity.java @@ -0,0 +1,197 @@ +package georgia.languagelandscape; + +import android.content.Intent; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.Snackbar; +import android.support.v4.app.ActivityCompat; +import android.support.v4.content.ContextCompat; +import android.support.v7.app.AppCompatActivity; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import com.android.volley.RequestQueue; +import com.android.volley.Response; +import com.android.volley.VolleyError; +import com.android.volley.VolleyLog; +import com.android.volley.toolbox.JsonObjectRequest; +import com.android.volley.toolbox.Volley; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.HashMap; +import java.util.Map; + +import georgia.languagelandscape.data.User; + +public class MainActivity extends AppCompatActivity { + + public static final int REQUEST_LOCATION = 1002; + TextView content; + + RequestQueue mRequestQueue; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + //Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + //setSupportActionBar(toolbar); + content = (TextView) findViewById(R.id.content); + + // ask for fine location access + if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) + != PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions( + this, + new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, + REQUEST_LOCATION); + } + + + Button button = (Button) findViewById(R.id.button); + button.setOnClickListener(new View.OnClickListener(){ + @Override + public void onClick(View view){ + + + EditText userText = (EditText) findViewById(R.id.nameText); + EditText passwordText = (EditText) findViewById(R.id.passText); + + if (mRequestQueue == null) { + mRequestQueue = Volley.newRequestQueue(getApplicationContext()); + } + + + String name = userText.getText().toString(); + String pass = passwordText.getText().toString(); + + User user = new User(); + + user.setUsername(name); + user.setPassword(pass); + + Map map = new HashMap<>(); + + map.put("username", user.getUsername()); + map.put("password", user.getPassword()); + + JSONObject json = new JSONObject(map); + + + sendMessage(json); + Toast.makeText(MainActivity.this, "Username: "+ user.getUsername() + " Password: " + user.getPassword() , Toast.LENGTH_SHORT).show(); + } + }); + + FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.mainFab); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Snackbar.make(view, "what ", Snackbar.LENGTH_LONG) + .setAction("Action", null).show(); + Intent myIntent = new Intent(MainActivity.this, MapActivity.class); +// myIntent.putExtra(MapActivity.FRAGMENT_ID, MapActivity.Frags.MAP); + myIntent.putExtra(MapActivity.FRAGMENT_ID, MapActivity.FRAG_MAP); + startActivity(myIntent); + finish(); + } + }); + } + + public void sendMessage(JSONObject object){ + try{ + String url = "http://a49007a8.ngrok.io"; + JsonObjectRequest req = new JsonObjectRequest(url, object, + new Response.Listener() { + @Override + public void onResponse(JSONObject response) { + try { + + VolleyLog.v("Response:%n %s", response.toString(4)); + doSthWithResponse(response); + } catch (JSONException e) { + e.printStackTrace(); + } + } + }, new Response.ErrorListener() { + @Override + public void onErrorResponse(VolleyError error) { + VolleyLog.e("Error: ", error.getMessage()); + } + }); + mRequestQueue.add(req); + } + catch (Exception e){ + e.printStackTrace(); + } + } + + + public void doSthWithResponse(JSONObject object){ + content.setText(object.toString()); + } + + + + class MyRequest { + String message; + String username; + String longitute; + String latitude; + + public MyRequest(String message, String longitute, String latitude) { + this.message = message; + this.longitute = longitute; + this.latitude = latitude; + this.username = "user"; + } + } + + + + + @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 onRequestPermissionsResult(int requestCode, + @NonNull String[] permissions, + @NonNull int[] grantResults) { + switch (requestCode) { + case REQUEST_LOCATION: + if (grantResults.length > 0 + && grantResults[0] == PackageManager.PERMISSION_GRANTED) { + } + // TODO: do something if location access denied. + } + } +} diff --git a/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MapActivity.java b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MapActivity.java new file mode 100644 index 0000000..4d3de46 --- /dev/null +++ b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MapActivity.java @@ -0,0 +1,218 @@ +package georgia.languagelandscape; + +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.location.Location; +import android.location.LocationListener; +import android.location.LocationManager; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.design.widget.FloatingActionButton; +import android.support.v4.app.ActivityCompat; +import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentTransaction; +import android.support.v4.content.ContextCompat; +import android.view.View; +import android.widget.Toast; + +public class MapActivity extends BaseActivity{ + + private static boolean active = false; + private static double longitude = 0.0; + private static double latitude = 0.0; + public final static String GEO_LONGITUDE = "geo_longitude"; + public final static String GEO_LATITUDE = "geo_latitude"; + public final static String FRAGMENT_ID = "fragment_id"; +// public static enum Frags {MAP, FEED, NEW_PROJECT, MY_PROJECT, PROFILE, SETTINGS}; + public static final int FRAG_MAP = 2000; + public static final int FRAG_FEED = 2001; + public static final int FRAG_NEW_PROJECT = 2002; + public static final int FRAG_MY_PROJECT = 2003; + public static final int FRAG_PROFILE = 2004; + public static final int FRAG_SETTINGS = 2005; + + private MapFragment mapFragment= null; + private FragmentManager fm = null; + private FragmentTransaction ft = null; + private LocationManager locationManager = null; + private Location currentLocation = null; + private LocationListener locationListener = null; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_navigation_drawer); + super.onDrawerCreated(); + active = true; + + mapFragment = new MapFragment(); + + if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) + != PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions( + this, + new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, + MainActivity.REQUEST_LOCATION); + } + + locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); + currentLocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); + if (currentLocation != null) { + longitude = currentLocation.getLongitude(); + latitude = currentLocation.getLatitude(); + } + locationListener = new LocationListener() { + @Override + public void onLocationChanged(Location location) { + if (isBetterLocation(location)){ + longitude = currentLocation.getLongitude(); + latitude = currentLocation.getLatitude(); + + Bundle bundle = new Bundle(); + bundle.putDouble(GEO_LONGITUDE, longitude); + bundle.putDouble(GEO_LATITUDE, latitude); + mapFragment.setArguments(bundle); + + try { + locationManager.removeUpdates(locationListener); + } catch (SecurityException e) { + e.printStackTrace(); + } + } + } + + @Override + public void onStatusChanged(String provider, int status, Bundle extras) { + + } + + @Override + public void onProviderEnabled(String provider) { + + } + + @Override + public void onProviderDisabled(String provider) { + + } + }; + locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener); + + /* check to see which fragment to replace */ +// Frags fragId = (Frags) getIntent().getExtras().getSerializable(FRAGMENT_ID); +// switch (fragId) { +// case MAP: +// +// } + + int fragId = getIntent().getIntExtra(FRAGMENT_ID, FRAG_MAP); + switch (fragId) { + case FRAG_MAP: + Bundle bundle = new Bundle(); + bundle.putDouble(GEO_LONGITUDE, longitude); + bundle.putDouble(GEO_LATITUDE, latitude); + mapFragment.setArguments(bundle); + fm = getSupportFragmentManager(); + ft = fm.beginTransaction(); + ft.replace(R.id.content_replace, mapFragment); + ft.commit(); + break; + case FRAG_NEW_PROJECT: + NewProjectFragment newProjectFragment= new NewProjectFragment(); + fm = getSupportFragmentManager(); + ft = fm.beginTransaction(); + ft.replace(R.id.content_replace, newProjectFragment); + ft.commit(); + break; + case FRAG_PROFILE: + ProfileFragment profileFragment = new ProfileFragment(); + fm = getSupportFragmentManager(); + ft = fm.beginTransaction(); + ft.replace(R.id.content_replace, profileFragment); + ft.commit(); + break; + case FRAG_MY_PROJECT: + MyProjectsFragment myProjectsFragment= new MyProjectsFragment(); + fm = getSupportFragmentManager(); + ft = fm.beginTransaction(); + ft.replace(R.id.content_replace, myProjectsFragment); + ft.commit(); + break; + default: + break; + } + + FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.homeFab); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(MapActivity.this, RecordingActivity.class); + intent.putExtra(GEO_LONGITUDE, longitude); + intent.putExtra(GEO_LATITUDE, latitude); + startActivity(intent); + } + }); + } + + @Override + protected void onPause() { + super.onPause(); + active = false; + } + + @Override + protected void onStop() { + super.onStop(); + active = false; + } + + @Override + protected void onResume() { + super.onResume(); + active = true; + } + + @Override + protected void onRestart() { + super.onRestart(); + active = true; + } + + @Override + public void onRequestPermissionsResult(int requestCode, + @NonNull String[] permissions, + @NonNull int[] grantResults) { + switch (requestCode) { + case MainActivity.REQUEST_LOCATION: + if (grantResults.length > 0 + && grantResults[0] == PackageManager.PERMISSION_GRANTED) { + Toast.makeText(this, "location access granted", Toast.LENGTH_SHORT).show(); + } + // TODO: do something if location access denied. + } + } + + public static double getLongitude() { + return longitude; + } + + public static double getLatitude() { + return latitude; + } + + public static boolean isActive() { + return active; + } + + private boolean isBetterLocation(Location location) { + if (currentLocation == null) { + return true; + } + + // check whether the new location is meets accuracy criteria + float accuracy = location.getAccuracy(); + return accuracy < 200; + } +} diff --git a/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MapFragment.java b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MapFragment.java new file mode 100644 index 0000000..9817677 --- /dev/null +++ b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MapFragment.java @@ -0,0 +1,61 @@ +package georgia.languagelandscape; + +//import android.app.Fragment; + +import android.support.v4.app.Fragment; + +import com.google.android.gms.maps.CameraUpdateFactory; +import com.google.android.gms.maps.GoogleMap; +import com.google.android.gms.maps.OnMapReadyCallback; +import com.google.android.gms.maps.SupportMapFragment; +import com.google.android.gms.maps.model.BitmapDescriptorFactory; +import com.google.android.gms.maps.model.CameraPosition; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.MarkerOptions; + +/** + * A simple {@link Fragment} subclass. + * Activities that contain this fragment must implement the + * {@link MapFragment.OnFragmentInteractionListener} interface + * to handle interaction events. + * Use the {@link MapFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class MapFragment extends SupportMapFragment implements OnMapReadyCallback { + + private GoogleMap mGoogleMap; + private double longitude = 0.0; + private double latitude = 0.0; + + @Override + public void onResume() { + super.onResume(); + if (mGoogleMap == null) { + getMapAsync(this); + } + } + + @Override + public void onMapReady(GoogleMap googleMap) { + mGoogleMap = googleMap; + + longitude = getArguments().getDouble(MapActivity.GEO_LONGITUDE); + latitude = getArguments().getDouble(MapActivity.GEO_LATITUDE); + + // create marker + MarkerOptions marker = new MarkerOptions().position( + new LatLng(latitude, longitude)).title("Hello Maps"); + + // Changing marker icon + marker.icon(BitmapDescriptorFactory + .defaultMarker(BitmapDescriptorFactory.HUE_ROSE)); + + // adding marker + googleMap.addMarker(marker); + CameraPosition cameraPosition = new CameraPosition.Builder() + .target(new LatLng(latitude, longitude)).zoom(5).build(); + googleMap.animateCamera(CameraUpdateFactory + .newCameraPosition(cameraPosition)); + } +} + diff --git a/app/src/main/java/georgia/languagelandscape/fragments/HelpAddProjectFragment.java b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MyProjectsFragment.java similarity index 72% rename from app/src/main/java/georgia/languagelandscape/fragments/HelpAddProjectFragment.java rename to Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MyProjectsFragment.java index 240c264..cda5ac9 100644 --- a/app/src/main/java/georgia/languagelandscape/fragments/HelpAddProjectFragment.java +++ b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MyProjectsFragment.java @@ -1,36 +1,29 @@ - -package georgia.languagelandscape.fragments; +package georgia.languagelandscape; import android.content.Context; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.webkit.WebSettings; -import android.webkit.WebView; -import android.webkit.WebViewClient; +import android.widget.ArrayAdapter; import android.widget.ListView; -import android.widget.TextView; -import georgia.languagelandscape.R; +import java.util.ArrayList; -//import android.support.v4.app.Fragment; +import georgia.languagelandscape.data.Projects; /** * A simple {@link Fragment} subclass. * Activities that contain this fragment must implement the - * {@link ProfileFragment.OnFragmentInteractionListener} interface + * {@link MyProjectsFragment.OnFragmentInteractionListener} interface * to handle interaction events. - * Use the {@link ProfileFragment#newInstance} factory method to + * Use the {@link MyProjectsFragment#newInstance} factory method to * create an instance of this fragment. */ -public class HelpAddProjectFragment extends Fragment implements MyProjectsFragment.OnFragmentInteractionListener, View.OnClickListener { +public class MyProjectsFragment extends Fragment { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; @@ -40,12 +33,9 @@ public class HelpAddProjectFragment extends Fragment implements MyProjectsFragme private String mParam1; private String mParam2; - private FragmentManager fm = null; - private FragmentTransaction ft = null; - private OnFragmentInteractionListener mListener; - public HelpAddProjectFragment() { + public MyProjectsFragment() { // Required empty public constructor } @@ -55,11 +45,11 @@ public HelpAddProjectFragment() { * * @param param1 Parameter 1. * @param param2 Parameter 2. - * @return A new instance of fragment ProfileFragment. + * @return A new instance of fragment MyProjectsFragment. */ // TODO: Rename and change types and number of parameters - public static HelpAddProjectFragment newInstance(String param1, String param2) { - HelpAddProjectFragment fragment = new HelpAddProjectFragment(); + public static MyProjectsFragment newInstance(String param1, String param2) { + MyProjectsFragment fragment = new MyProjectsFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); @@ -67,17 +57,20 @@ public static HelpAddProjectFragment newInstance(String param1, String param2) { return fragment; } - @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } } + + ListView listView; + ArrayList listItems= Projects.getArrayList(); + ArrayAdapter adapter; + @Override public void onStart() { super.onStart(); @@ -86,8 +79,16 @@ public void onStart() { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + // Inflate the layout for this fragment + + View view = inflater.inflate(R.layout.fragment_my_projects, container, false); + + listView=(ListView) view.findViewById(R.id.listview_projects); + + adapter= new ArrayAdapter(getActivity(), android.R.layout.simple_list_item_1, listItems); + listView.setAdapter(adapter); - return inflater.inflate(R.layout.fragment_help_make_recording, container, false); + return view; } // TODO: Rename method, update argument and hook method into UI event @@ -114,12 +115,6 @@ public void onDetach() { mListener = null; } - @Override - public void onClick(View v) { - - } - - /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated @@ -135,9 +130,5 @@ public interface OnFragmentInteractionListener { void onFragmentInteraction(Uri uri); } - @Override - public void onFragmentInteraction(Uri uri) { - } - -} \ No newline at end of file +} diff --git a/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MyRecordingsActivity.java b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MyRecordingsActivity.java new file mode 100644 index 0000000..0e478a6 --- /dev/null +++ b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/MyRecordingsActivity.java @@ -0,0 +1,4 @@ +package georgia.languagelandscape; + +public class MyRecordingsActivity extends BaseActivity { +} diff --git a/app/src/main/java/georgia/languagelandscape/fragments/HelpAddLanguageFragment.java b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/NewProjectFragment.java similarity index 68% rename from app/src/main/java/georgia/languagelandscape/fragments/HelpAddLanguageFragment.java rename to Llapp_latest_version/app/src/main/java/georgia/languagelandscape/NewProjectFragment.java index 1d7505e..bcdad77 100644 --- a/app/src/main/java/georgia/languagelandscape/fragments/HelpAddLanguageFragment.java +++ b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/NewProjectFragment.java @@ -1,36 +1,28 @@ - -package georgia.languagelandscape.fragments; +package georgia.languagelandscape; import android.content.Context; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.webkit.WebSettings; -import android.webkit.WebView; -import android.webkit.WebViewClient; -import android.widget.ListView; -import android.widget.TextView; - -import georgia.languagelandscape.R; +import android.widget.Button; +import android.widget.EditText; +import android.widget.LinearLayout; -//import android.support.v4.app.Fragment; +import georgia.languagelandscape.data.Projects; /** * A simple {@link Fragment} subclass. * Activities that contain this fragment must implement the - * {@link ProfileFragment.OnFragmentInteractionListener} interface + * {@link NewProjectFragment.OnFragmentInteractionListener} interface * to handle interaction events. - * Use the {@link ProfileFragment#newInstance} factory method to + * Use the {@link NewProjectFragment#newInstance} factory method to * create an instance of this fragment. */ -public class HelpAddLanguageFragment extends Fragment implements MyProjectsFragment.OnFragmentInteractionListener, View.OnClickListener { +public class NewProjectFragment extends Fragment { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; @@ -40,12 +32,15 @@ public class HelpAddLanguageFragment extends Fragment implements MyProjectsFragm private String mParam1; private String mParam2; - private FragmentManager fm = null; - private FragmentTransaction ft = null; + LinearLayout container; + + EditText new_project; + String tv_project_name; + final Projects project=new Projects(); private OnFragmentInteractionListener mListener; - public HelpAddLanguageFragment() { + public NewProjectFragment() { // Required empty public constructor } @@ -55,11 +50,11 @@ public HelpAddLanguageFragment() { * * @param param1 Parameter 1. * @param param2 Parameter 2. - * @return A new instance of fragment ProfileFragment. + * @return A new instance of fragment NewProjectFragment. */ // TODO: Rename and change types and number of parameters - public static HelpAddLanguageFragment newInstance(String param1, String param2) { - HelpAddLanguageFragment fragment = new HelpAddLanguageFragment(); + public static NewProjectFragment newInstance(String param1, String param2) { + NewProjectFragment fragment = new NewProjectFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); @@ -68,26 +63,40 @@ public static HelpAddLanguageFragment newInstance(String param1, String param2) } + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } - } - @Override - public void onStart() { - super.onStart(); + } + Button addButton; + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + // Inflate the layout for this fragment + + View view = inflater.inflate(R.layout.fragment_new_project, container, false); + + new_project=(EditText) view.findViewById(R.id.editText_new_project); - return inflater.inflate(R.layout.fragment_help_make_recording, container, false); + + addButton= (Button) view.findViewById(R.id.button_add_project); + + addButton.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) + { + addItem(tv_project_name); + } + }); + + return view; } // TODO: Rename method, update argument and hook method into UI event @@ -114,12 +123,6 @@ public void onDetach() { mListener = null; } - @Override - public void onClick(View v) { - - } - - /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated @@ -135,9 +138,10 @@ public interface OnFragmentInteractionListener { void onFragmentInteraction(Uri uri); } - @Override - public void onFragmentInteraction(Uri uri) { + public void addItem(String name) { + tv_project_name= String.valueOf(new_project.getText()); + project.addItem(tv_project_name); + System.out.println(tv_project_name); } - -} \ No newline at end of file +} diff --git a/app/src/main/java/georgia/languagelandscape/fragments/HelpAdvancedSearchFragment.java b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/ProfileFragment.java similarity index 78% rename from app/src/main/java/georgia/languagelandscape/fragments/HelpAdvancedSearchFragment.java rename to Llapp_latest_version/app/src/main/java/georgia/languagelandscape/ProfileFragment.java index abeb688..7cc12fb 100644 --- a/app/src/main/java/georgia/languagelandscape/fragments/HelpAdvancedSearchFragment.java +++ b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/ProfileFragment.java @@ -1,18 +1,13 @@ +package georgia.languagelandscape; -package georgia.languagelandscape.fragments; - +import android.support.v4.app.Fragment; import android.content.Context; import android.net.Uri; import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import georgia.languagelandscape.R; - //import android.support.v4.app.Fragment; @@ -24,7 +19,7 @@ * Use the {@link ProfileFragment#newInstance} factory method to * create an instance of this fragment. */ -public class HelpAdvancedSearchFragment extends Fragment implements MyProjectsFragment.OnFragmentInteractionListener, View.OnClickListener { +public class ProfileFragment extends Fragment { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; @@ -34,12 +29,9 @@ public class HelpAdvancedSearchFragment extends Fragment implements MyProjectsFr private String mParam1; private String mParam2; - private FragmentManager fm = null; - private FragmentTransaction ft = null; - private OnFragmentInteractionListener mListener; - public HelpAdvancedSearchFragment() { + public ProfileFragment() { // Required empty public constructor } @@ -52,8 +44,8 @@ public HelpAdvancedSearchFragment() { * @return A new instance of fragment ProfileFragment. */ // TODO: Rename and change types and number of parameters - public static HelpAdvancedSearchFragment newInstance(String param1, String param2) { - HelpAdvancedSearchFragment fragment = new HelpAdvancedSearchFragment(); + public static ProfileFragment newInstance(String param1, String param2) { + ProfileFragment fragment = new ProfileFragment(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); @@ -61,27 +53,20 @@ public static HelpAdvancedSearchFragment newInstance(String param1, String param return fragment; } - @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } } - @Override - public void onStart() { - super.onStart(); - } - @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - - return inflater.inflate(R.layout.fragment_help_make_recording, container, false); + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_profile, container, false); } // TODO: Rename method, update argument and hook method into UI event @@ -108,12 +93,6 @@ public void onDetach() { mListener = null; } - @Override - public void onClick(View v) { - - } - - /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated @@ -128,10 +107,4 @@ public interface OnFragmentInteractionListener { // TODO: Update argument type and name void onFragmentInteraction(Uri uri); } - - @Override - public void onFragmentInteraction(Uri uri) { - } - - -} \ No newline at end of file +} diff --git a/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/RecordingActivity.java b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/RecordingActivity.java new file mode 100644 index 0000000..2cdcad7 --- /dev/null +++ b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/RecordingActivity.java @@ -0,0 +1,535 @@ +package georgia.languagelandscape; + +import android.Manifest; +import android.content.Context; +import android.content.pm.PackageManager; +import android.location.Address; +import android.location.Geocoder; +import android.location.Location; +import android.location.LocationListener; +import android.location.LocationManager; +import android.media.MediaMetadataRetriever; +import android.media.MediaPlayer; +import android.media.MediaRecorder; +import android.os.Bundle; +import android.os.Environment; +import android.os.Handler; +import android.support.annotation.NonNull; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.TextInputLayout; +import android.support.v4.app.ActivityCompat; +import android.support.v4.content.ContextCompat; +import android.util.Log; +import android.view.KeyEvent; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputMethodManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import java.io.File; +import java.io.FilenameFilter; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +import georgia.languagelandscape.data.Recording; + +public class RecordingActivity extends BaseActivity { + + private static final String LOG_TAG = "AudioRecordTest"; + public static final int REQUEST_RECORD_AUDIO = 1001; + public static final int CACHE_SIZE = 1024; + private boolean audioPermissionGranted = false; + private static String audioFileName = null; + private static boolean canRecord = true; + private static boolean canPlay = true; + private long recordingTime = 0L; + private Recording recording = null; + private String defaultRecordingTitle = "New Recording"; + private String recordingTitle = null; + private ArrayList recordingLanguages = null; + private String audioCacheFilePath = null; + private String defaultAudioFormat = ".3gp"; + private String audioInternalFilePath = null; + private File audioInternalFileDir = null; + private String recordingDescription = null; + private ArrayList recordingSpeaker = null; + private double longitude = 0.0; + private double latitude = 0.0; + private static String location = null; + + private LocationManager locationManager = null; + private LocationListener locationListener = null; + + private Location currentLocation = null; + private FloatingActionButton recordButton = null; + private MediaRecorder recorder = null; + private FloatingActionButton playButton = null; + private MediaPlayer player = null; + private TextView recordingTimer = null; + private Handler handler = null; + private Runnable timerRunnable = null; + private TextView recordingName = null; + private TextView recordingDate = null; + private TextView recordingLocation = null; + private EditText userDefinedName = null; + private EditText userDefinedLanguages = null; + private EditText userDefinedDescription = null; + private EditText userDefinedSpeakers = null; + private Button doneButton = null; + private TextInputLayout nameInputLayout = null; + private TextInputLayout languageInputLayout = null; + + @Override + protected void onCreate(Bundle savedInstanceState) { + // TODO: clean the file stored in the cache + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_record_nav_drawer); + super.onDrawerCreated(); + + recordingTimer = (TextView) findViewById(R.id.timer); + recordingName = (TextView) findViewById(R.id.recording_name); + recordingDate = (TextView) findViewById(R.id.recording_date); + recordingLocation = (TextView) findViewById(R.id.recording_location); + nameInputLayout = (TextInputLayout) findViewById(R.id.userDefined_name_textInput_layout); + recordingLanguages = new ArrayList<>(); + recordingSpeaker = new ArrayList<>(); + + userDefinedName = (EditText) findViewById(R.id.userDefined_name); + userDefinedLanguages = (EditText) findViewById(R.id.userDefined_languages); + userDefinedDescription = (EditText) findViewById(R.id.userDefined_description); + userDefinedSpeakers = (EditText) findViewById(R.id.userDefined_speakers); + + try { + audioInternalFilePath = getFilesDir().getCanonicalPath() + "/recordings"; + audioInternalFileDir = new File(audioInternalFilePath); + if (!audioInternalFileDir.exists()) { + boolean fileCreated = audioInternalFileDir.mkdir(); + Log.d(LOG_TAG, "internal audio file dir created: " + String.valueOf(fileCreated)); + } + Log.d(LOG_TAG, "internal audio file dir already exist"); + } catch (IOException e) { + e.printStackTrace(); + } + int numDup = checkDuplication(defaultRecordingTitle); + recordingTitle = numDup == 0 ? defaultRecordingTitle : defaultRecordingTitle + " " + numDup; + recordingName.setText(recordingTitle); + nameInputLayout.setHint(recordingTitle); + + longitude = getIntent().getExtras().getDouble(MapActivity.GEO_LONGITUDE); + latitude = getIntent().getExtras().getDouble(MapActivity.GEO_LATITUDE); + location = updateLocation(longitude, latitude); + recordingLocation.setText(location); + + doneButton = (Button) findViewById(R.id.button_done); + doneButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + // if nothing has been recorded + File from = new File(audioFileName); + if (!from.exists()) { + finish(); + return; + } + // mandatory fields need to have info + String languages = userDefinedLanguages.getText().toString(); + if (languages.equals("")) { + userDefinedLanguages.requestFocus(); + View view = getCurrentFocus(); + if (view != null) { + InputMethodManager imm = (InputMethodManager) + getSystemService(Context.INPUT_METHOD_SERVICE); + imm.showSoftInput(view, 0); + } +// languageInputLayout.setError("Which language did you speak?"); + return; + } else { + recordingLanguages.add(languages); + } + + String speakers = userDefinedSpeakers.getText().toString(); + if (speakers.equals("")) { + userDefinedSpeakers.requestFocus(); + View view = getCurrentFocus(); + if (view != null) { + InputMethodManager imm = (InputMethodManager) + getSystemService(Context.INPUT_METHOD_SERVICE); + imm.showSoftInput(view, 0); + } +// userDefinedSpeakers.setError("Please specify the speaker."); + return; + } else { + recordingSpeaker.add(speakers); + } + + String description = userDefinedDescription.getText().toString(); + recordingDescription = description.equals("") ? null : description; + + String title = userDefinedName.getText().toString(); + recordingTitle = title.equals("") ? defaultRecordingTitle : title; + + /* copy the file from cache to internal storage */ + int numDup; + if (recordingTitle.matches(defaultRecordingTitle + " [0-9]+$")) { + numDup = checkDuplication(defaultRecordingTitle); + recordingTitle = + numDup == 0 ? defaultRecordingTitle : defaultRecordingTitle + " " + numDup; + } else { + numDup = checkDuplication(recordingTitle); + recordingTitle = + numDup == 0 ? recordingTitle : recordingTitle + " " + numDup; + } + File to = new File(audioInternalFileDir, recordingTitle + defaultAudioFormat); + audioFileName = to.getAbsolutePath(); + boolean success = from.renameTo(to); + + /* build the recording class from data collected */ + if (success) { + MediaMetadataRetriever mmr = new MediaMetadataRetriever(); + mmr.setDataSource(audioFileName); + String durationStr = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION); + long duration = Long.parseLong(durationStr); + recording = new Recording(); + recording.setDuration(duration); + recording.setTitle(recordingTitle); + recording.setDate(recordingDate.getText().toString()); + recording.setDescription(recordingDescription); + recording.setLanguage(recordingLanguages); + recording.setSpeakers(recordingSpeaker); + recording.setLatitude(latitude); + recording.setLongitude(longitude); + recording.setLocation(location); + Log.i(LOG_TAG, recording.toString()); + // TODO: set the uploader in the future + // TODO: take to the list of recordings the user has + + } else { + if (!canPlay){ + stopPlaying(); + } + } + } + }); + + userDefinedName.setOnEditorActionListener(new TextView.OnEditorActionListener() { + @Override + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + switch (actionId) { + case EditorInfo.IME_ACTION_NEXT: + userDefinedLanguages.requestFocus(); + return true; + default: + return false; + } + } + }); + userDefinedLanguages.setOnEditorActionListener(new TextView.OnEditorActionListener() { + @Override + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + switch (actionId) { + case EditorInfo.IME_ACTION_NEXT: + userDefinedSpeakers.requestFocus(); + return true; + default: + return false; + } + } + }); + + userDefinedSpeakers.setOnEditorActionListener(new TextView.OnEditorActionListener() { + @Override + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + switch (actionId) { + case EditorInfo.IME_ACTION_NEXT: + userDefinedDescription.requestFocus(); + return true; + default: + return false; + } + } + }); + + userDefinedDescription.setOnEditorActionListener(new TextView.OnEditorActionListener() { + @Override + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + switch (actionId) { + case EditorInfo.IME_ACTION_DONE: + userDefinedDescription.clearFocus(); + View view = getCurrentFocus(); + if (view != null) { + InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(view.getWindowToken(), 0); + } + return true; + default: + return false; + } + } + }); + + handler = new Handler(); + timerRunnable = new Runnable() { + @Override + public void run() { + long elapsed = System.currentTimeMillis() - recordingTime; + int seconds = (int) (elapsed / 1000); + int millis = (int) (elapsed % 1000) / 10; + int minutes = seconds / 60; + seconds = seconds % 60; + + recordingTimer.setText(String.format("%02d:%02d.%02d", minutes, seconds, millis)); + handler.postDelayed(this, 0); + } + }; + + try { + audioCacheFilePath = getCacheDir().getCanonicalPath(); + } catch (IOException e) { + e.printStackTrace(); + } + audioFileName = audioCacheFilePath + "/" + System.currentTimeMillis() + defaultAudioFormat; + + recordButton = (FloatingActionButton) findViewById(R.id.recorder); + recordButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onRecord(canRecord); + } + }); + + playButton = (FloatingActionButton) findViewById(R.id.player); + playButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onPlay(canPlay); + } + }); + + Date currentDateTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy", Locale.UK); + recordingDate.setText(formatter.format(currentDateTime)); + } + + private int checkDuplication(final String recordingTitle) { + Log.d(LOG_TAG, "Duplicated files: "); + String[] recordings = audioInternalFileDir.list(new FilenameFilter() { + @Override + public boolean accept(File dir, String name) { + return name.endsWith(defaultAudioFormat) + && name.startsWith(recordingTitle); + } + }); + for (String recording : recordings) { + Log.i(LOG_TAG, recording); + } + return recordings.length; + } + + private void onPlay(boolean canPlay) { + if (canPlay) + startPlaying(); + else + stopPlaying(); + } + + private void stopPlaying() { + player.release(); + player = null; + canPlay = true; + doneButton.setClickable(true); + recordButton.setClickable(true); + } + + private void startPlaying() { + canPlay = false; + doneButton.setClickable(true); + recordButton.setClickable(false); + + player = new MediaPlayer(); + player.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { + @Override + public void onCompletion(MediaPlayer mp) { + canPlay = true; + recordButton.setClickable(true); + } + }); + + try { + player.setDataSource(audioFileName); + player.prepare(); + } catch (IOException e) { + Log.i(LOG_TAG, "playing failed"); + } + player.start(); + } + + @Override + public void onStop() { + super.onStop(); + if (recorder != null) { + recorder.release(); + recorder = null; + } + + if (player != null) { + player.release(); + player = null; + } + } + + private void onRecord(boolean canRecord) { + if (canRecord) { + startRecording(); + } else { + stopRecording(); + } + } + + private void stopRecording() { + canRecord = true; + doneButton.setClickable(true); + playButton.setClickable(true); + + recorder.stop(); + handler.removeCallbacks(timerRunnable); + recorder.release(); + recorder = null; + /* + * Animation: + * -the screen contracts to the top + * -edit|play|delete buttons appear at the bottom of the waveform + * -a list of information about the new recording will appear down below the waveform + * -save & [save and] upload buttons + * */ + } + + private void startRecording() { + if (!audioPermissionGranted) { + int permissionCheck = ContextCompat.checkSelfPermission( + this, Manifest.permission.RECORD_AUDIO); + if (permissionCheck != PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions( + this, + new String[]{Manifest.permission.RECORD_AUDIO}, + REQUEST_RECORD_AUDIO); + return; + } else { + audioPermissionGranted = true; + } + } + + canRecord = false; + doneButton.setClickable(false); + playButton.setClickable(false); + + recorder = new MediaRecorder(); + recorder.setAudioSource(MediaRecorder.AudioSource.MIC); + recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); + recorder.setOutputFile(audioFileName); + recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); + + try { + recorder.prepare(); + } catch (IOException e) { + Log.i(LOG_TAG, "prepare() failed."); + } + recordingTime = System.currentTimeMillis(); + handler.postDelayed(timerRunnable, 0); + recorder.start(); + } + + private String updateLocation(double longitude, double latitude) { + Geocoder gcd = new Geocoder(this.getBaseContext(), Locale.getDefault()); + String cityName = null; + String countryName = null; + String location = null; + try { + List
addresses = gcd.getFromLocation( + latitude, + longitude, + 1); + if (addresses.size() > 0) { + cityName = addresses.get(0).getLocality(); + countryName = addresses.get(0).getCountryName(); + location = cityName + ", " + countryName; + return location; + } else { + return null; + } + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.navigation_drawer, 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); + } + + /* Checks if external storage is available for read and write */ + public boolean isExternalStorageWritable() { + String state = Environment.getExternalStorageState(); + return Environment.MEDIA_MOUNTED.equals(state); + } + + /* Checks if external storage is available to at least read */ + public boolean isExternalStorageReadable() { + String state = Environment.getExternalStorageState(); + return (Environment.MEDIA_MOUNTED.equals(state) || + Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)); + } + + private boolean askLocationPermission() { +// if (!isExternalStorageReadable() || !isExternalStorageWritable()) { +// Toast.makeText(this, "This app only works on devices with usable external storage", +// Toast.LENGTH_SHORT).show(); +// return false; +// } + return true; + } + + @Override + public void onRequestPermissionsResult(int requestCode, + @NonNull String[] permissions, + @NonNull int[] grantResults) { + switch (requestCode) { + case REQUEST_RECORD_AUDIO: + if (grantResults.length > 0 + && grantResults[0] == PackageManager.PERMISSION_GRANTED) { + audioPermissionGranted = true; + } else { + //TODO: pop up a box with two buttons: 'cancel' and 'settings' + Toast.makeText(this, + "Unable to record.\nGo to Settings > Privacy to change the permission", + Toast.LENGTH_SHORT).show(); +// finish(); + } + } + } +} \ No newline at end of file diff --git a/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/data/Projects.java b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/data/Projects.java new file mode 100644 index 0000000..dca2f92 --- /dev/null +++ b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/data/Projects.java @@ -0,0 +1,24 @@ +package georgia.languagelandscape.data; + +import java.util.ArrayList; + +/** + * Created by Georgia on 3/15/2017. + */ + +public class Projects { + + static ArrayList names= new ArrayList(); + + public static void addItem(String name) + { + names.add(name); + } + + public static ArrayList getArrayList() + { + for(int i=0;i language = null; + private String date = null; + private String uploader = null; + private ArrayList speakers = null; + + public Recording() { + } + + public Recording(String title, + long duration, + String description, + double latitude, + double longitude, + String location, + ArrayList language, + String date, + String uploader, + ArrayList speakers) { + + this.title = title; + this.duration = duration; + this.description = description; + this.latitude = latitude; + this.longitude = longitude; + this.location = location; + this.language = language; + this.date = date; + this.uploader = uploader; + this.speakers = speakers; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public long getDuration() { + return duration; + } + + public void setDuration(long duration) { + this.duration = duration; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public double getLatitude() { + return latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public double getLongitude() { + return longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public ArrayList getLanguage() { + return language; + } + + public void setLanguage(ArrayList language) { + this.language = language; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getUploader() { + return uploader; + } + + public void setUploader(String uploader) { + this.uploader = uploader; + } + + public ArrayList getSpeakers() { + return speakers; + } + + public void setSpeakers(ArrayList speakers) { + this.speakers = speakers; + } + + @Override + public String toString() { + return "Recording{" + + "title='" + title + '\'' + + ", duration=" + duration + + ", description='" + description + '\'' + + ", latitude=" + latitude + + ", longitude=" + longitude + + ", location='" + location + '\'' + + ", language=" + language + + ", date='" + date + '\'' + + ", uploader='" + uploader + '\'' + + ", speakers=" + speakers + + '}'; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(title); + dest.writeLong(duration); + dest.writeString(description); + dest.writeDouble(latitude); + dest.writeDouble(longitude); + dest.writeString(location); + dest.writeStringList(language); + dest.writeString(date); + dest.writeString(uploader); + dest.writeStringList(speakers); + } + + protected Recording(Parcel in) { + title = in.readString(); + duration = in.readLong(); + description = in.readString(); + latitude = in.readDouble(); + longitude = in.readDouble(); + location = in.readString(); + language = in.createStringArrayList(); + date = in.readString(); + uploader = in.readString(); + speakers = in.createStringArrayList(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public Recording createFromParcel(Parcel in) { + return new Recording(in); + } + + @Override + public Recording[] newArray(int size) { + return new Recording[size]; + } + }; +} diff --git a/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/data/User.java b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/data/User.java new file mode 100644 index 0000000..55e0e80 --- /dev/null +++ b/Llapp_latest_version/app/src/main/java/georgia/languagelandscape/data/User.java @@ -0,0 +1,25 @@ +package georgia.languagelandscape.data; + +public class User { + + String username; + String password; + + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + +} diff --git a/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_camera.xml b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_camera.xml new file mode 100644 index 0000000..0d9ea10 --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_camera.xml @@ -0,0 +1,12 @@ + + + + diff --git a/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_gallery.xml b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_gallery.xml new file mode 100644 index 0000000..f6872c4 --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_gallery.xml @@ -0,0 +1,9 @@ + + + diff --git a/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_manage.xml b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_manage.xml new file mode 100644 index 0000000..c1be60b --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_manage.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_send.xml b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_send.xml new file mode 100644 index 0000000..00c668c --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_send.xml @@ -0,0 +1,9 @@ + + + diff --git a/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_share.xml b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_share.xml new file mode 100644 index 0000000..a28fb9e --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_share.xml @@ -0,0 +1,9 @@ + + + diff --git a/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_slideshow.xml b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_slideshow.xml new file mode 100644 index 0000000..209aa64 --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/drawable-v21/ic_menu_slideshow.xml @@ -0,0 +1,9 @@ + + + diff --git a/Llapp_latest_version/app/src/main/res/drawable/side_nav_bar.xml b/Llapp_latest_version/app/src/main/res/drawable/side_nav_bar.xml new file mode 100644 index 0000000..458b4b0 --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/drawable/side_nav_bar.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/Llapp_latest_version/app/src/main/res/layout/activity_main.xml b/Llapp_latest_version/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..0c97a4d --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/Llapp_latest_version/app/src/main/res/layout/activity_myrecordings.xml b/Llapp_latest_version/app/src/main/res/layout/activity_myrecordings.xml new file mode 100644 index 0000000..52e7c34 --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/layout/activity_myrecordings.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Llapp_latest_version/app/src/main/res/layout/activity_navigation_drawer.xml b/Llapp_latest_version/app/src/main/res/layout/activity_navigation_drawer.xml new file mode 100644 index 0000000..993598f --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/layout/activity_navigation_drawer.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/Llapp_latest_version/app/src/main/res/layout/activity_record.xml b/Llapp_latest_version/app/src/main/res/layout/activity_record.xml new file mode 100644 index 0000000..6ed683b --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/layout/activity_record.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Llapp_latest_version/app/src/main/res/layout/activity_record_nav_drawer.xml b/Llapp_latest_version/app/src/main/res/layout/activity_record_nav_drawer.xml new file mode 100644 index 0000000..8d1eb31 --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/layout/activity_record_nav_drawer.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/Llapp_latest_version/app/src/main/res/layout/app_bar_navigation_drawer.xml b/Llapp_latest_version/app/src/main/res/layout/app_bar_navigation_drawer.xml new file mode 100644 index 0000000..68ed2a9 --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/layout/app_bar_navigation_drawer.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + diff --git a/Llapp_latest_version/app/src/main/res/layout/content_main.xml b/Llapp_latest_version/app/src/main/res/layout/content_main.xml new file mode 100644 index 0000000..01fa786 --- /dev/null +++ b/Llapp_latest_version/app/src/main/res/layout/content_main.xml @@ -0,0 +1,63 @@ + + + + + + + +