diff --git a/app/.gitignore b/app/.gitignore new file mode 100755 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/.idea/.name b/app/.idea/.name new file mode 100755 index 0000000..99cf1f5 --- /dev/null +++ b/app/.idea/.name @@ -0,0 +1 @@ +ShippingApp \ No newline at end of file diff --git a/app/.idea/compiler.xml b/app/.idea/compiler.xml new file mode 100755 index 0000000..96cc43e --- /dev/null +++ b/app/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/copyright/profiles_settings.xml b/app/.idea/copyright/profiles_settings.xml new file mode 100755 index 0000000..e7bedf3 --- /dev/null +++ b/app/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/app/.idea/gradle.xml b/app/.idea/gradle.xml new file mode 100755 index 0000000..d417c89 --- /dev/null +++ b/app/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/animated_vector_drawable_24_2_1.xml b/app/.idea/libraries/animated_vector_drawable_24_2_1.xml new file mode 100755 index 0000000..080e437 --- /dev/null +++ b/app/.idea/libraries/animated_vector_drawable_24_2_1.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/appcompat_v7_24_2_1.xml b/app/.idea/libraries/appcompat_v7_24_2_1.xml new file mode 100755 index 0000000..0a95009 --- /dev/null +++ b/app/.idea/libraries/appcompat_v7_24_2_1.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/constraint_layout_1_0_0_beta4.xml b/app/.idea/libraries/constraint_layout_1_0_0_beta4.xml new file mode 100755 index 0000000..41439a2 --- /dev/null +++ b/app/.idea/libraries/constraint_layout_1_0_0_beta4.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/constraint_layout_solver_1_0_0_beta4.xml b/app/.idea/libraries/constraint_layout_solver_1_0_0_beta4.xml new file mode 100755 index 0000000..725f457 --- /dev/null +++ b/app/.idea/libraries/constraint_layout_solver_1_0_0_beta4.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/design_24_2_1.xml b/app/.idea/libraries/design_24_2_1.xml new file mode 100755 index 0000000..03dc3d9 --- /dev/null +++ b/app/.idea/libraries/design_24_2_1.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/espresso_core_2_2_2.xml b/app/.idea/libraries/espresso_core_2_2_2.xml new file mode 100755 index 0000000..a2711e8 --- /dev/null +++ b/app/.idea/libraries/espresso_core_2_2_2.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/espresso_idling_resource_2_2_2.xml b/app/.idea/libraries/espresso_idling_resource_2_2_2.xml new file mode 100755 index 0000000..3bc2aec --- /dev/null +++ b/app/.idea/libraries/espresso_idling_resource_2_2_2.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/exposed_instrumentation_api_publish_0_5.xml b/app/.idea/libraries/exposed_instrumentation_api_publish_0_5.xml new file mode 100755 index 0000000..ca22178 --- /dev/null +++ b/app/.idea/libraries/exposed_instrumentation_api_publish_0_5.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/gson_2_7.xml b/app/.idea/libraries/gson_2_7.xml new file mode 100755 index 0000000..2260755 --- /dev/null +++ b/app/.idea/libraries/gson_2_7.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/hamcrest_core_1_3.xml b/app/.idea/libraries/hamcrest_core_1_3.xml new file mode 100755 index 0000000..157e3f3 --- /dev/null +++ b/app/.idea/libraries/hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/hamcrest_integration_1_3.xml b/app/.idea/libraries/hamcrest_integration_1_3.xml new file mode 100755 index 0000000..58b2c4b --- /dev/null +++ b/app/.idea/libraries/hamcrest_integration_1_3.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/hamcrest_library_1_3.xml b/app/.idea/libraries/hamcrest_library_1_3.xml new file mode 100755 index 0000000..676cc63 --- /dev/null +++ b/app/.idea/libraries/hamcrest_library_1_3.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/javawriter_2_1_1.xml b/app/.idea/libraries/javawriter_2_1_1.xml new file mode 100755 index 0000000..a66fefb --- /dev/null +++ b/app/.idea/libraries/javawriter_2_1_1.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/javax_annotation_api_1_2.xml b/app/.idea/libraries/javax_annotation_api_1_2.xml new file mode 100755 index 0000000..811e73f --- /dev/null +++ b/app/.idea/libraries/javax_annotation_api_1_2.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/javax_inject_1.xml b/app/.idea/libraries/javax_inject_1.xml new file mode 100755 index 0000000..0d1d5fc --- /dev/null +++ b/app/.idea/libraries/javax_inject_1.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/jsr305_2_0_1.xml b/app/.idea/libraries/jsr305_2_0_1.xml new file mode 100755 index 0000000..cdf9878 --- /dev/null +++ b/app/.idea/libraries/jsr305_2_0_1.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/junit_4_12.xml b/app/.idea/libraries/junit_4_12.xml new file mode 100755 index 0000000..305df30 --- /dev/null +++ b/app/.idea/libraries/junit_4_12.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/recyclerview_v7_24_2_1.xml b/app/.idea/libraries/recyclerview_v7_24_2_1.xml new file mode 100755 index 0000000..f44b22c --- /dev/null +++ b/app/.idea/libraries/recyclerview_v7_24_2_1.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/rules_0_5.xml b/app/.idea/libraries/rules_0_5.xml new file mode 100755 index 0000000..6e9bbd1 --- /dev/null +++ b/app/.idea/libraries/rules_0_5.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/runner_0_5.xml b/app/.idea/libraries/runner_0_5.xml new file mode 100755 index 0000000..3649172 --- /dev/null +++ b/app/.idea/libraries/runner_0_5.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/support_annotations_24_2_1.xml b/app/.idea/libraries/support_annotations_24_2_1.xml new file mode 100755 index 0000000..57de104 --- /dev/null +++ b/app/.idea/libraries/support_annotations_24_2_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/support_compat_24_2_1.xml b/app/.idea/libraries/support_compat_24_2_1.xml new file mode 100755 index 0000000..157926d --- /dev/null +++ b/app/.idea/libraries/support_compat_24_2_1.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/support_core_ui_24_2_1.xml b/app/.idea/libraries/support_core_ui_24_2_1.xml new file mode 100755 index 0000000..5321c25 --- /dev/null +++ b/app/.idea/libraries/support_core_ui_24_2_1.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/support_core_utils_24_2_1.xml b/app/.idea/libraries/support_core_utils_24_2_1.xml new file mode 100755 index 0000000..d843b63 --- /dev/null +++ b/app/.idea/libraries/support_core_utils_24_2_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/support_fragment_24_2_1.xml b/app/.idea/libraries/support_fragment_24_2_1.xml new file mode 100755 index 0000000..1cec72e --- /dev/null +++ b/app/.idea/libraries/support_fragment_24_2_1.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/support_media_compat_24_2_1.xml b/app/.idea/libraries/support_media_compat_24_2_1.xml new file mode 100755 index 0000000..b3ceea7 --- /dev/null +++ b/app/.idea/libraries/support_media_compat_24_2_1.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/support_v4_24_2_1.xml b/app/.idea/libraries/support_v4_24_2_1.xml new file mode 100755 index 0000000..51c387c --- /dev/null +++ b/app/.idea/libraries/support_v4_24_2_1.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/libraries/support_vector_drawable_24_2_1.xml b/app/.idea/libraries/support_vector_drawable_24_2_1.xml new file mode 100755 index 0000000..f05a055 --- /dev/null +++ b/app/.idea/libraries/support_vector_drawable_24_2_1.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/markdown-navigator/profiles_settings.xml b/app/.idea/markdown-navigator/profiles_settings.xml new file mode 100755 index 0000000..674a591 --- /dev/null +++ b/app/.idea/markdown-navigator/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/app/.idea/misc.xml b/app/.idea/misc.xml new file mode 100755 index 0000000..6c50245 --- /dev/null +++ b/app/.idea/misc.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/modules.xml b/app/.idea/modules.xml new file mode 100755 index 0000000..d64ec39 --- /dev/null +++ b/app/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/.idea/runConfigurations.xml b/app/.idea/runConfigurations.xml new file mode 100755 index 0000000..7f68460 --- /dev/null +++ b/app/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/.idea/workspace.xml b/app/.idea/workspace.xml new file mode 100755 index 0000000..d68df4d --- /dev/null +++ b/app/.idea/workspace.xml @@ -0,0 +1,2654 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1481816888965 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file://$PROJECT_DIR$/src/main/java/com/pb/nex26dv/shippingapp/orderplacing.java + 355 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100755 index 0000000..9225dd9 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,33 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 24 + buildToolsVersion "25.0.1" + defaultConfig { + applicationId "com.pb.nex26dv.shippingapp" + minSdkVersion 19 + targetSdkVersion 24 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + 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:24.2.1' + compile 'com.android.support:design:24.2.1' + compile 'com.android.support:support-v4:24.2.1' + compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4' + testCompile 'junit:junit:4.12' + compile 'com.google.code.gson:gson:2.7' +} diff --git a/app/gradle/wrapper/gradle-wrapper.jar b/app/gradle/wrapper/gradle-wrapper.jar new file mode 100755 index 0000000..13372ae Binary files /dev/null and b/app/gradle/wrapper/gradle-wrapper.jar differ diff --git a/app/gradle/wrapper/gradle-wrapper.properties b/app/gradle/wrapper/gradle-wrapper.properties new file mode 100755 index 0000000..04e285f --- /dev/null +++ b/app/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/app/gradlew b/app/gradlew new file mode 100755 index 0000000..9d82f78 --- /dev/null +++ b/app/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/app/gradlew.bat b/app/gradlew.bat new file mode 100755 index 0000000..8a0b282 --- /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/local.properties b/app/local.properties new file mode 100755 index 0000000..5fee15f --- /dev/null +++ b/app/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. +#Thu Dec 15 21:18:08 IST 2016 +sdk.dir=F\:\\Android\\sdk diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100755 index 0000000..f0a5cbf --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in C:\Users\NEX26DV\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/app/src/androidTest/java/com/pb/nex26dv/shippingapp/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/pb/nex26dv/shippingapp/ExampleInstrumentedTest.java new file mode 100755 index 0000000..e3a5919 --- /dev/null +++ b/app/src/androidTest/java/com/pb/nex26dv/shippingapp/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.pb.nex26dv.shippingapp; + +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("com.pb.nex26dv.shippingapp", appContext.getPackageName()); + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100755 index 0000000..bef2013 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml.bak b/app/src/main/AndroidManifest.xml.bak new file mode 100755 index 0000000..8efc98d --- /dev/null +++ b/app/src/main/AndroidManifest.xml.bak @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/Contact.java b/app/src/main/java/com/pb/nex26dv/shippingapp/Contact.java new file mode 100755 index 0000000..838cd7f --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/Contact.java @@ -0,0 +1,44 @@ +package com.pb.nex26dv.shippingapp; + +/** + * Created by NEX9ZKA on 12/7/2016. + */ + +public class Contact { + private String name; + private String email; + private String mobile; + private String pass; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getPass() { + return pass; + } + + public void setPass(String pass) { + this.pass = pass; + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/DBHelper.java b/app/src/main/java/com/pb/nex26dv/shippingapp/DBHelper.java new file mode 100755 index 0000000..46c1635 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/DBHelper.java @@ -0,0 +1,87 @@ +package com.pb.nex26dv.shippingapp; + +import android.content.ContentValues; +import android.content.Context; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; +import android.database.sqlite.SQLiteOpenHelper; + +/** + * Created by NEX9ZKA on 12/7/2016. + */ + +public class DBHelper extends SQLiteOpenHelper{ + private static final int DATABASE_VERSION = 1; + private static final String DATABASE_NAME = "contacts.db"; + private static final String TABLE_NAME = "contacts"; + private static final String COLUMN_ID = "id"; + private static final String COLUMN_NAME = "name"; + private static final String COLUMN_EMAIL = "email"; + private static final String COLUMN_Mobile = "mobile"; + private static final String COLUMN_PASS = "pass"; + + SQLiteDatabase db; + + public DBHelper(Context context) { + super(context, DATABASE_NAME, null, DATABASE_VERSION); + } + + private static final String TABLE_CREATE = "create table " + TABLE_NAME + " (id integer primary key not null , " + + "name text not null, email text not null, mobile text not null, pass text not null);"; + + + @Override + public void onCreate(SQLiteDatabase db) { + db.execSQL(TABLE_CREATE); + this.db = db; + } + + @Override + public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { + String query = "DROP table if exists " + TABLE_NAME + " ;"; + db.execSQL(query); + + this.onCreate(db); + } + + public void insertContact(Contact c) { + db = this.getWritableDatabase(); + ContentValues contentValues = new ContentValues(); + + String query = "SELECT * FROM contacts"; + + Cursor cursor = db.rawQuery(query, null); + int count = cursor.getCount(); + + contentValues.put(COLUMN_ID, count); + contentValues.put(COLUMN_NAME, c.getName()); + contentValues.put(COLUMN_EMAIL, c.getEmail()); + contentValues.put(COLUMN_Mobile, c.getMobile()); + contentValues.put(COLUMN_PASS, c.getPass()); + + db.insert(TABLE_NAME, null, contentValues); + db.close(); + } + + public String searchPass(String email) { + db = this.getReadableDatabase(); + + String query = "select email, pass from " + TABLE_NAME; + Cursor cursor = db.rawQuery(query, null); + + String mail, password; + password = "not found"; + if (cursor.moveToFirst()) { + do { + mail = cursor.getString(0); + + + if (mail.equals(email)) { + password = cursor.getString(1); + break; + } + } while (cursor.moveToNext()); + } + return password; + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Address.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Address.java new file mode 100755 index 0000000..50019b7 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Address.java @@ -0,0 +1,151 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class Address { + private List addressLines = new ArrayList(); + private String cityTown = null; + private String stateProvince = null; + private String postalCode = null; + private String countryCode = null; + private String company = null; + private String name = null; + private String phone = null; + private String email = null; + private Boolean residential = null; + private String taxId = null; + private Address.StatusEnum status = null; + + public Address() { + } + + public List getAddressLines() { + return this.addressLines; + } + + public void setAddressLines(List addressLines) { + this.addressLines = addressLines; + } + + public String getCityTown() { + return this.cityTown; + } + + public void setCityTown(String cityTown) { + this.cityTown = cityTown; + } + + public String getStateProvince() { + return this.stateProvince; + } + + public void setStateProvince(String stateProvince) { + this.stateProvince = stateProvince; + } + + public String getPostalCode() { + return this.postalCode; + } + + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + public String getCountryCode() { + return this.countryCode; + } + + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + public String getCompany() { + return this.company; + } + + public void setCompany(String company) { + this.company = company; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return this.phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getEmail() { + return this.email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Boolean getResidential() { + return this.residential; + } + + public void setResidential(Boolean residential) { + this.residential = residential; + } + + public String getTaxId() { + return this.taxId; + } + + public void setTaxId(String taxId) { + this.taxId = taxId; + } + + public Address.StatusEnum getStatus() { + return this.status; + } + + public void setStatus(Address.StatusEnum status) { + this.status = status; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Address {\n"); + sb.append(" addressLines: ").append(this.addressLines).append("\n"); + sb.append(" cityTown: ").append(this.cityTown).append("\n"); + sb.append(" stateProvince: ").append(this.stateProvince).append("\n"); + sb.append(" postalCode: ").append(this.postalCode).append("\n"); + sb.append(" countryCode: ").append(this.countryCode).append("\n"); + sb.append(" company: ").append(this.company).append("\n"); + sb.append(" name: ").append(this.name).append("\n"); + sb.append(" phone: ").append(this.phone).append("\n"); + sb.append(" email: ").append(this.email).append("\n"); + sb.append(" residential: ").append(this.residential).append("\n"); + sb.append(" taxId: ").append(this.taxId).append("\n"); + sb.append(" status: ").append(this.status).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + public static enum StatusEnum { + PARSED, + VALIDATED_CHANGED, + VALIDATED_AND_NOT_CHANGED, + NOT_CHANGED; + + private StatusEnum() { + } + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CarrierAccount.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CarrierAccount.java new file mode 100755 index 0000000..4739bf4 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CarrierAccount.java @@ -0,0 +1,31 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class CarrierAccount { + private List parameters = new ArrayList(); + + public CarrierAccount() { + } + + public List getParameters() { + return this.parameters; + } + + public void setParameters(List parameters) { + this.parameters = parameters; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CarrierAccount {\n"); + sb.append(" parameters: ").append(this.parameters).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CarrierPayment.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CarrierPayment.java new file mode 100755 index 0000000..5ef5b2d --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CarrierPayment.java @@ -0,0 +1,85 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class CarrierPayment { + private CarrierPayment.TypeOfChargeEnum typeOfCharge = null; + private CarrierPayment.PartyEnum party = null; + private String accountNumber = null; + private String postalCode = null; + private String countryCode = null; + + public CarrierPayment() { + } + public CarrierPayment.TypeOfChargeEnum getTypeOfCharge() { + return this.typeOfCharge; + } + + public void setTypeOfCharge(CarrierPayment.TypeOfChargeEnum typeOfCharge) { + this.typeOfCharge = typeOfCharge; + } + + public CarrierPayment.PartyEnum getParty() { + return this.party; + } + + public void setParty(CarrierPayment.PartyEnum party) { + this.party = party; + } + + public String getAccountNumber() { + return this.accountNumber; + } + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + public String getPostalCode() { + return this.postalCode; + } + + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + public String getCountryCode() { + return this.countryCode; + } + + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CarrierPayment {\n"); + sb.append(" typeOfCharge: ").append(this.typeOfCharge).append("\n"); + sb.append(" party: ").append(this.party).append("\n"); + sb.append(" accountNumber: ").append(this.accountNumber).append("\n"); + sb.append(" postalCode: ").append(this.postalCode).append("\n"); + sb.append(" countryCode: ").append(this.countryCode).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + public static enum PartyEnum { + BILL_RECEIVER, + BILL_SENDER, + BILL_THIRD_PARTY; + + private PartyEnum() { + } + } + + public static enum TypeOfChargeEnum { + TRANSPORTATION_CHARGES, + DUTIES_AND_TAXES, + ALL_CHARGES; + + private TypeOfChargeEnum() { + } + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Customs.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Customs.java new file mode 100755 index 0000000..2815d89 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Customs.java @@ -0,0 +1,41 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class Customs { + private CustomsInfo customsInfo = null; + private List customsItems = new ArrayList(); + + public Customs() { + } + + public CustomsInfo getCustomsInfo() { + return this.customsInfo; + } + + public void setCustomsInfo(CustomsInfo customsInfo) { + this.customsInfo = customsInfo; + } + + public List getCustomsItems() { + return this.customsItems; + } + + public void setCustomsItems(List customsItems) { + this.customsItems = customsItems; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Customs {\n"); + sb.append(" customsInfo: ").append(this.customsInfo).append("\n"); + sb.append(" customsItems: ").append(this.customsItems).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CustomsInfo.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CustomsInfo.java new file mode 100755 index 0000000..696241d --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CustomsInfo.java @@ -0,0 +1,191 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class CustomsInfo { + private CustomsInfo.ReasonForExportEnum reasonForExport = null; + private String reasonForExportExplanation = null; + private String comments = null; + private String invoiceNumber = null; + private String termsOfSale = null; + private String importerCustomsReference = null; + private String insuredNumber = null; + private Double insuredAmount = null; + private Double sdrValue = null; + private String EELPFC = null; + private String fromCustomsReference = null; + private Double customsDeclaredValue = null; + private String currencyCode = null; + private String declarationStatement = null; + private String licenseNumber = null; + private String certificateNumber = null; + + public CustomsInfo() { + } + + public CustomsInfo.ReasonForExportEnum getReasonForExport() { + return this.reasonForExport; + } + + public void setReasonForExport(CustomsInfo.ReasonForExportEnum reasonForExport) { + this.reasonForExport = reasonForExport; + } + + public String getReasonForExportExplanation() { + return this.reasonForExportExplanation; + } + + public void setReasonForExportExplanation(String reasonForExportExplanation) { + this.reasonForExportExplanation = reasonForExportExplanation; + } + + public String getComments() { + return this.comments; + } + + public void setComments(String comments) { + this.comments = comments; + } + + + public String getInvoiceNumber() { + return this.invoiceNumber; + } + + public void setInvoiceNumber(String invoiceNumber) { + this.invoiceNumber = invoiceNumber; + } + + public String getTermsOfSale() { + return this.termsOfSale; + } + + public void setTermsOfSale(String termsOfSale) { + this.termsOfSale = termsOfSale; + } + + public String getImporterCustomsReference() { + return this.importerCustomsReference; + } + + public void setImporterCustomsReference(String importerCustomsReference) { + this.importerCustomsReference = importerCustomsReference; + } + + public String getInsuredNumber() { + return this.insuredNumber; + } + + public void setInsuredNumber(String insuredNumber) { + this.insuredNumber = insuredNumber; + } + + public Double getInsuredAmount() { + return this.insuredAmount; + } + + public void setInsuredAmount(Double insuredAmount) { + this.insuredAmount = insuredAmount; + } + + public Double getSdrValue() { + return this.sdrValue; + } + + public void setSdrValue(Double sdrValue) { + this.sdrValue = sdrValue; + } + + public String getEELPFC() { + return this.EELPFC; + } + + public void setEELPFC(String EELPFC) { + this.EELPFC = EELPFC; + } + + public String getFromCustomsReference() { + return this.fromCustomsReference; + } + + public void setFromCustomsReference(String fromCustomsReference) { + this.fromCustomsReference = fromCustomsReference; + } + + public Double getCustomsDeclaredValue() { + return this.customsDeclaredValue; + } + + public void setCustomsDeclaredValue(Double customsDeclaredValue) { + this.customsDeclaredValue = customsDeclaredValue; + } + + public String getCurrencyCode() { + return this.currencyCode; + } + + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + } + + public String getDeclarationStatement() { + return this.declarationStatement; + } + + public void setDeclarationStatement(String declarationStatement) { + this.declarationStatement = declarationStatement; + } + + public String getLicenseNumber() { + return this.licenseNumber; + } + + public void setLicenseNumber(String licenseNumber) { + this.licenseNumber = licenseNumber; + } + + public String getCertificateNumber() { + return this.certificateNumber; + } + + public void setCertificateNumber(String certificateNumber) { + this.certificateNumber = certificateNumber; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomsInfo {\n"); + sb.append(" reasonForExport: ").append(this.reasonForExport).append("\n"); + sb.append(" reasonForExportExplanation: ").append(this.reasonForExportExplanation).append("\n"); + sb.append(" comments: ").append(this.comments).append("\n"); + sb.append(" invoiceNumber: ").append(this.invoiceNumber).append("\n"); + sb.append(" termsOfSale: ").append(this.termsOfSale).append("\n"); + sb.append(" importerCustomsReference: ").append(this.importerCustomsReference).append("\n"); + sb.append(" insuredNumber: ").append(this.insuredNumber).append("\n"); + sb.append(" insuredAmount: ").append(this.insuredAmount).append("\n"); + sb.append(" sdrValue: ").append(this.sdrValue).append("\n"); + sb.append(" EELPFC: ").append(this.EELPFC).append("\n"); + sb.append(" fromCustomsReference: ").append(this.fromCustomsReference).append("\n"); + sb.append(" customsDeclaredValue: ").append(this.customsDeclaredValue).append("\n"); + sb.append(" currencyCode: ").append(this.currencyCode).append("\n"); + sb.append(" declarationStatement: ").append(this.declarationStatement).append("\n"); + sb.append(" licenseNumber: ").append(this.licenseNumber).append("\n"); + sb.append(" certificateNumber: ").append(this.certificateNumber).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + public static enum ReasonForExportEnum { + GIFT, + COMMERCIAL_SAMPLE, + MERCHANDISE, + DOCUMENTS, + RETURNED_GOODS, + OTHER; + + private ReasonForExportEnum() { + } + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CustomsItem.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CustomsItem.java new file mode 100755 index 0000000..26fcf28 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/CustomsItem.java @@ -0,0 +1,98 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class CustomsItem { + private String description = null; + private Integer quantity = null; + private String quantityUOM = null; + private Double unitPrice = null; + private ParcelWeight unitWeight = null; + private String hSTariffCode = null; + private String originStateProvince = null; + private String originCountryCode = null; + + public CustomsItem() { + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Integer getQuantity() { + return this.quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public String getQuantityUOM() { + return this.quantityUOM; + } + + public void setQuantityUOM(String quantityUOM) { + this.quantityUOM = quantityUOM; + } + + public Double getUnitPrice() { + return this.unitPrice; + } + + public void setUnitPrice(Double unitPrice) { + this.unitPrice = unitPrice; + } + + public ParcelWeight getUnitWeight() { + return this.unitWeight; + } + + public void setUnitWeight(ParcelWeight unitWeight) { + this.unitWeight = unitWeight; + } + + public String getHSTariffCode() { + return this.hSTariffCode; + } + + public void setHSTariffCode(String hSTariffCode) { + this.hSTariffCode = hSTariffCode; + } + + public String getOriginStateProvince() { + return this.originStateProvince; + } + + public void setOriginStateProvince(String originStateProvince) { + this.originStateProvince = originStateProvince; + } + + public String getOriginCountryCode() { + return this.originCountryCode; + } + + public void setOriginCountryCode(String originCountryCode) { + this.originCountryCode = originCountryCode; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomsItem {\n"); + sb.append(" description: ").append(this.description).append("\n"); + sb.append(" quantity: ").append(this.quantity).append("\n"); + sb.append(" quantityUOM: ").append(this.quantityUOM).append("\n"); + sb.append(" unitPrice: ").append(this.unitPrice).append("\n"); + sb.append(" unitWeight: ").append(this.unitWeight).append("\n"); + sb.append(" hSTariffCode: ").append(this.hSTariffCode).append("\n"); + sb.append(" originStateProvince: ").append(this.originStateProvince).append("\n"); + sb.append(" originCountryCode: ").append(this.originCountryCode).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/DeliveryCommitment.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/DeliveryCommitment.java new file mode 100755 index 0000000..28f6f61 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/DeliveryCommitment.java @@ -0,0 +1,67 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class DeliveryCommitment { + private String minEstimatedNumberOfDays = null; + private String maxEstimatedNumberOfDays = null; + private String estimatedDeliveryDateTime = null; + private String guarantee = null; + private String additionalDetails = null; + + public DeliveryCommitment() { + } + + public String getMinEstimatedNumberOfDays() { + return this.minEstimatedNumberOfDays; + } + + public void setMinEstimatedNumberOfDays(String minEstimatedNumberOfDays) { + this.minEstimatedNumberOfDays = minEstimatedNumberOfDays; + } + public String getMaxEstimatedNumberOfDays() { + return this.maxEstimatedNumberOfDays; + } + + public void setMaxEstimatedNumberOfDays(String maxEstimatedNumberOfDays) { + this.maxEstimatedNumberOfDays = maxEstimatedNumberOfDays; + } + + public String getEstimatedDeliveryDateTime() { + return this.estimatedDeliveryDateTime; + } + + public void setEstimatedDeliveryDateTime(String estimatedDeliveryDateTime) { + this.estimatedDeliveryDateTime = estimatedDeliveryDateTime; + } + + public String getGuarantee() { + return this.guarantee; + } + + public void setGuarantee(String guarantee) { + this.guarantee = guarantee; + } + + public String getAdditionalDetails() { + return this.additionalDetails; + } + + public void setAdditionalDetails(String additionalDetails) { + this.additionalDetails = additionalDetails; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeliveryCommitment {\n"); + sb.append(" minEstimatedNumberOfDays: ").append(this.minEstimatedNumberOfDays).append("\n"); + sb.append(" maxEstimatedNumberOfDays: ").append(this.maxEstimatedNumberOfDays).append("\n"); + sb.append(" estimatedDeliveryDateTime: ").append(this.estimatedDeliveryDateTime).append("\n"); + sb.append(" guarantee: ").append(this.guarantee).append("\n"); + sb.append(" additionalDetails: ").append(this.additionalDetails).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Discount.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Discount.java new file mode 100755 index 0000000..bb27715 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Discount.java @@ -0,0 +1,38 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class Discount { + private String name = null; + private Double discountAmount = null; + + public Discount() { + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Double getDiscountAmount() { + return this.discountAmount; + } + + public void setDiscountAmount(Double discountAmount) { + this.discountAmount = discountAmount; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Discount {\n"); + sb.append(" name: ").append(this.name).append("\n"); + sb.append(" discountAmount: ").append(this.discountAmount).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Document.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Document.java new file mode 100755 index 0000000..d787686 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Document.java @@ -0,0 +1,133 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class Document { + private Document.TypeEnum type = null; + private Document.SizeEnum size = null; + private Document.FileFormatEnum fileFormat = null; + private Document.ContentTypeEnum contentType = null; + private Document.PrintDialogOptionEnum printDialogOption = null; + private String contents = null; + private List pages = new ArrayList(); + + public Document() { + } + + public Document.TypeEnum getType() { + return this.type; + } + + public void setType(Document.TypeEnum type) { + this.type = type; + } + + public Document.SizeEnum getSize() { + return this.size; + } + + public void setSize(Document.SizeEnum size) { + this.size = size; + } + + public Document.FileFormatEnum getFileFormat() { + return this.fileFormat; + } + + public void setFileFormat(Document.FileFormatEnum fileFormat) { + this.fileFormat = fileFormat; + } + + public Document.ContentTypeEnum getContentType() { + return this.contentType; + } + + public void setContentType(Document.ContentTypeEnum contentType) { + this.contentType = contentType; + } + + public Document.PrintDialogOptionEnum getPrintDialogOption() { + return this.printDialogOption; + } + + public void setPrintDialogOption(Document.PrintDialogOptionEnum printDialogOption) { + this.printDialogOption = printDialogOption; + } + + public String getContents() { + return this.contents; + } + + public void setContents(String contents) { + this.contents = contents; + } + + public List getPages() { + return this.pages; + } + + public void setPages(List pages) { + this.pages = pages; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Document {\n"); + sb.append(" type: ").append(this.type).append("\n"); + sb.append(" size: ").append(this.size).append("\n"); + sb.append(" fileFormat: ").append(this.fileFormat).append("\n"); + sb.append(" contentType: ").append(this.contentType).append("\n"); + sb.append(" printDialogOption: ").append(this.printDialogOption).append("\n"); + sb.append(" contents: ").append(this.contents).append("\n"); + sb.append(" pages: ").append(this.pages).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + public static enum PrintDialogOptionEnum { + NO_PRINT_DIALOG, + EMBED_PRINT_DIALOG; + + private PrintDialogOptionEnum() { + } + } + + public static enum ContentTypeEnum { + URL, + BASE64; + + private ContentTypeEnum() { + } + } + + public static enum FileFormatEnum { + PDF, + PNG, + ZPL2; + + private FileFormatEnum() { + } + } + + public static enum SizeEnum { + DOC_2X7, + DOC_4X6, + DOC_8X11; + + private SizeEnum() { + } + } + + public static enum TypeEnum { + SHIPPING_LABEL, + MANIFEST; + + private TypeEnum() { + } + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Page.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Page.java new file mode 100755 index 0000000..9df5a26 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Page.java @@ -0,0 +1,28 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class Page { + private String contents = null; + + public Page() { + } + + public String getContents() { + return this.contents; + } + + public void setContents(String contents) { + this.contents = contents; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Page {\n"); + sb.append(" contents: ").append(this.contents).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Parameter.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Parameter.java new file mode 100755 index 0000000..5ebf34f --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Parameter.java @@ -0,0 +1,38 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class Parameter { + private String name = null; + private String value = null; + + public Parameter() { + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Parameter {\n"); + sb.append(" name: ").append(this.name).append("\n"); + sb.append(" value: ").append(this.value).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Parcel.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Parcel.java new file mode 100755 index 0000000..f99bc52 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Parcel.java @@ -0,0 +1,38 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class Parcel { + private ParcelWeight weight = null; + private ParcelDimension dimension = null; + + public Parcel() { + } + + public ParcelWeight getWeight() { + return this.weight; + } + + public void setWeight(ParcelWeight weight) { + this.weight = weight; + } + + public ParcelDimension getDimension() { + return this.dimension; + } + + public void setDimension(ParcelDimension dimension) { + this.dimension = dimension; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Parcel {\n"); + sb.append(" weight: ").append(this.weight).append("\n"); + sb.append(" dimension: ").append(this.dimension).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/ParcelDimension.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/ParcelDimension.java new file mode 100755 index 0000000..39a852d --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/ParcelDimension.java @@ -0,0 +1,76 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class ParcelDimension { + private Double length = null; + private Double width = null; + private Double height = null; + private ParcelDimension.UnitOfMeasurementEnum unitOfMeasurement = null; + private Double irregularParcelGirth = null; + + public ParcelDimension() { + } + + public Double getLength() { + return this.length; + } + + public void setLength(Double length) { + this.length = length; + } + + public Double getWidth() { + return this.width; + } + + public void setWidth(Double width) { + this.width = width; + } + + public Double getHeight() { + return this.height; + } + + public void setHeight(Double height) { + this.height = height; + } + + public ParcelDimension.UnitOfMeasurementEnum getUnitOfMeasurement() { + return this.unitOfMeasurement; + } + + public void setUnitOfMeasurement(ParcelDimension.UnitOfMeasurementEnum unitOfMeasurement) { + this.unitOfMeasurement = unitOfMeasurement; + } + + public Double getIrregularParcelGirth() { + return this.irregularParcelGirth; + } + + public void setIrregularParcelGirth(Double irregularParcelGirth) { + this.irregularParcelGirth = irregularParcelGirth; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParcelDimension {\n"); + sb.append(" length: ").append(this.length).append("\n"); + sb.append(" width: ").append(this.width).append("\n"); + sb.append(" height: ").append(this.height).append("\n"); + sb.append(" unitOfMeasurement: ").append(this.unitOfMeasurement).append("\n"); + sb.append(" irregularParcelGirth: ").append(this.irregularParcelGirth).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + public static enum UnitOfMeasurementEnum { + CM, + IN; + + private UnitOfMeasurementEnum() { + } + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/ParcelWeight.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/ParcelWeight.java new file mode 100755 index 0000000..59be060 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/ParcelWeight.java @@ -0,0 +1,46 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class ParcelWeight { + private Double weight = null; + private ParcelWeight.UnitOfMeasurementEnum unitOfMeasurement = null; + + public ParcelWeight() { + } + + public Double getWeight() { + return this.weight; + } + + public void setWeight(Double weight) { + this.weight = weight; + } + + public ParcelWeight.UnitOfMeasurementEnum getUnitOfMeasurement() { + return this.unitOfMeasurement; + } + + public void setUnitOfMeasurement(ParcelWeight.UnitOfMeasurementEnum unitOfMeasurement) { + this.unitOfMeasurement = unitOfMeasurement; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParcelWeight {\n"); + sb.append(" weight: ").append(this.weight).append("\n"); + sb.append(" unitOfMeasurement: ").append(this.unitOfMeasurement).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + public static enum UnitOfMeasurementEnum { + GM, + OZ; + + private UnitOfMeasurementEnum() { + } + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Rate.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Rate.java new file mode 100755 index 0000000..78864e5 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Rate.java @@ -0,0 +1,171 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class Rate { + private String carrier = null; + private String parcelType = null; + private String serviceId = null; + private String rateTypeId = null; + private List specialServices = new ArrayList(); + private String inductionPostalCode = null; + private ParcelWeight dimensionalWeight = null; + private Double totalCarrierCharge = null; + private Double totalTaxAmount = null; + private Double baseCharge = null; + private List baseChargeTaxes = new ArrayList(); + private List surcharges = new ArrayList(); + private List discounts = new ArrayList(); + private DeliveryCommitment deliveryCommitment = null; + private String currencyCode = null; + + public Rate() { + } + + public String getCarrier() { + return this.carrier; + } + + public void setCarrier(String carrier) { + this.carrier = carrier; + } + + public String getParcelType() { + return this.parcelType; + } + + public void setParcelType(String parcelType) { + this.parcelType = parcelType; + } + + public String getServiceId() { + return this.serviceId; + } + + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + + public String getRateTypeId() { + return this.rateTypeId; + } + + public void setRateTypeId(String rateTypeId) { + this.rateTypeId = rateTypeId; + } + + public List getSpecialServices() { + return this.specialServices; + } + + public void setSpecialServices(List specialServices) { + this.specialServices = specialServices; + } + + public String getInductionPostalCode() { + return this.inductionPostalCode; + } + + public void setInductionPostalCode(String inductionPostalCode) { + this.inductionPostalCode = inductionPostalCode; + } + + public ParcelWeight getDimensionalWeight() { + return this.dimensionalWeight; + } + + public void setDimensionalWeight(ParcelWeight dimensionalWeight) { + this.dimensionalWeight = dimensionalWeight; + } + + public Double getTotalCarrierCharge() { + return this.totalCarrierCharge; + } + + public void setTotalCarrierCharge(Double totalCarrierCharge) { + this.totalCarrierCharge = totalCarrierCharge; + } + + public Double getTotalTaxAmount() { + return this.totalTaxAmount; + } + + public void setTotalTaxAmount(Double totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + } + + public Double getBaseCharge() { + return this.baseCharge; + } + + public void setBaseCharge(Double baseCharge) { + this.baseCharge = baseCharge; + } + + public List getBaseChargeTaxes() { + return this.baseChargeTaxes; + } + + public void setBaseChargeTaxes(List baseChargeTaxes) { + this.baseChargeTaxes = baseChargeTaxes; + } + + public List getSurcharges() { + return this.surcharges; + } + + public void setSurcharges(List surcharges) { + this.surcharges = surcharges; + } + + public List getDiscounts() { + return this.discounts; + } + + public void setDiscounts(List discounts) { + this.discounts = discounts; + } + + public DeliveryCommitment getDeliveryCommitment() { + return this.deliveryCommitment; + } + + public void setDeliveryCommitment(DeliveryCommitment deliveryCommitment) { + this.deliveryCommitment = deliveryCommitment; + } + + public String getCurrencyCode() { + return this.currencyCode; + } + + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Rate {\n"); + sb.append(" carrier: ").append(this.carrier).append("\n"); + sb.append(" parcelType: ").append(this.parcelType).append("\n"); + sb.append(" serviceId: ").append(this.serviceId).append("\n"); + sb.append(" rateTypeId: ").append(this.rateTypeId).append("\n"); + sb.append(" specialServices: ").append(this.specialServices).append("\n"); + sb.append(" inductionPostalCode: ").append(this.inductionPostalCode).append("\n"); + sb.append(" dimensionalWeight: ").append(this.dimensionalWeight).append("\n"); + sb.append(" totalCarrierCharge: ").append(this.totalCarrierCharge).append("\n"); + sb.append(" totalTaxAmount: ").append(this.totalTaxAmount).append("\n"); + sb.append(" baseCharge: ").append(this.baseCharge).append("\n"); + sb.append(" baseChargeTaxes: ").append(this.baseChargeTaxes).append("\n"); + sb.append(" surcharges: ").append(this.surcharges).append("\n"); + sb.append(" discounts: ").append(this.discounts).append("\n"); + sb.append(" deliveryCommitment: ").append(this.deliveryCommitment).append("\n"); + sb.append(" currencyCode: ").append(this.currencyCode).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Shipment.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Shipment.java new file mode 100755 index 0000000..a1ec97c --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Shipment.java @@ -0,0 +1,151 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +import java.util.ArrayList; +import java.util.List; + +public class Shipment { + private Address fromAddress = null; + private Address toAddress = null; + private Address altReturnAddress = null; + private Address soldToAddress = null; + private Parcel parcel = null; + private List rates = new ArrayList(); + private Customs customs = null; + private String shipmentId = null; + private String parcelTrackingNumber = null; + private List documents = new ArrayList(); + private List carrierAccounts = new ArrayList(); + private List carrierPayments = new ArrayList(); + private List shipmentOptions = new ArrayList(); + + public Shipment() { + } + + public Address getFromAddress() { + return this.fromAddress; + } + + public void setFromAddress(Address fromAddress) { + this.fromAddress = fromAddress; + } + + public Address getToAddress() { + return this.toAddress; + } + + public void setToAddress(Address toAddress) { + this.toAddress = toAddress; + } + + public Address getAltReturnAddress() { + return this.altReturnAddress; + } + + public void setAltReturnAddress(Address altReturnAddress) { + this.altReturnAddress = altReturnAddress; + } + + public Address getSoldToAddress() { + return this.soldToAddress; + } + + public void setSoldToAddress(Address soldToAddress) { + this.soldToAddress = soldToAddress; + } + + public Parcel getParcel() { + return this.parcel; + } + + public void setParcel(Parcel parcel) { + this.parcel = parcel; + } + + public List getRates() { + return this.rates; + } + + public void setRates(List rates) { + this.rates = rates; + } + + public Customs getCustoms() { + return this.customs; + } + + public void setCustoms(Customs customs) { + this.customs = customs; + } + + public String getShipmentId() { + return this.shipmentId; + } + + public void setShipmentId(String shipmentId) { + this.shipmentId = shipmentId; + } + + public String getParcelTrackingNumber() { + return this.parcelTrackingNumber; + } + + public void setParcelTrackingNumber(String parcelTrackingNumber) { + this.parcelTrackingNumber = parcelTrackingNumber; + } + + public List getDocuments() { + return this.documents; + } + + public void setDocuments(List documents) { + this.documents = documents; + } + + public List getCarrierAccounts() { + return this.carrierAccounts; + } + + public void setCarrierAccounts(List carrierAccounts) { + this.carrierAccounts = carrierAccounts; + } + + public List getCarrierPayments() { + return this.carrierPayments; + } + + public void setCarrierPayments(List carrierPayments) { + this.carrierPayments = carrierPayments; + } + + public List getShipmentOptions() { + return this.shipmentOptions; + } + + public void setShipmentOptions(List shipmentOptions) { + this.shipmentOptions = shipmentOptions; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Shipment {\n"); + sb.append(" fromAddress: ").append(this.fromAddress).append("\n"); + sb.append(" toAddress: ").append(this.toAddress).append("\n"); + sb.append(" altReturnAddress: ").append(this.altReturnAddress).append("\n"); + sb.append(" soldToAddress: ").append(this.soldToAddress).append("\n"); + sb.append(" parcel: ").append(this.parcel).append("\n"); + sb.append(" rates: ").append(this.rates).append("\n"); + sb.append(" customs: ").append(this.customs).append("\n"); + sb.append(" shipmentId: ").append(this.shipmentId).append("\n"); + sb.append(" parcelTrackingNumber: ").append(this.parcelTrackingNumber).append("\n"); + sb.append(" documents: ").append(this.documents).append("\n"); + sb.append(" carrierAccounts: ").append(this.carrierAccounts).append("\n"); + sb.append(" carrierPayments: ").append(this.carrierPayments).append("\n"); + sb.append(" shipmentOptions: ").append(this.shipmentOptions).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/SpecialService.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/SpecialService.java new file mode 100755 index 0000000..be766c7 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/SpecialService.java @@ -0,0 +1,51 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class SpecialService { + private String specialServiceId = null; + private Double fee = null; + private List inputParameters = new ArrayList(); + + public SpecialService() { + } + + public String getSpecialServiceId() { + return this.specialServiceId; + } + + public void setSpecialServiceId(String specialServiceId) { + this.specialServiceId = specialServiceId; + } + + public Double getFee() { + return this.fee; + } + + public void setFee(Double fee) { + this.fee = fee; + } + + public List getInputParameters() { + return this.inputParameters; + } + + public void setInputParameters(List inputParameters) { + this.inputParameters = inputParameters; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialService {\n"); + sb.append(" specialServiceId: ").append(this.specialServiceId).append("\n"); + sb.append(" fee: ").append(this.fee).append("\n"); + sb.append(" inputParameters: ").append(this.inputParameters).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Surcharge.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Surcharge.java new file mode 100755 index 0000000..064e308 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Surcharge.java @@ -0,0 +1,38 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class Surcharge { + private String name = null; + private Double fee = null; + + public Surcharge() { + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Double getFee() { + return this.fee; + } + + public void setFee(Double fee) { + this.fee = fee; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Surcharge {\n"); + sb.append(" name: ").append(this.name).append("\n"); + sb.append(" fee: ").append(this.fee).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Tax.java b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Tax.java new file mode 100755 index 0000000..bc7bc92 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/JsonObjects/Tax.java @@ -0,0 +1,59 @@ +package com.pb.nex26dv.shippingapp.JsonObjects; + +/** + * Created by nex9zka on 12/9/2016. + */ + +public class Tax { + private String name = null; + private Double taxAmount = null; + private Double taxRate = null; + private String displayName = null; + + public Tax() { + } + + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + + public Double getTaxAmount() { + return this.taxAmount; + } + + public void setTaxAmount(Double taxAmount) { + this.taxAmount = taxAmount; + } + public Double getTaxRate() { + return this.taxRate; + } + + public void setTaxRate(Double taxRate) { + this.taxRate = taxRate; + } + + public String getDisplayName() { + return this.displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tax {\n"); + sb.append(" name: ").append(this.name).append("\n"); + sb.append(" taxAmount: ").append(this.taxAmount).append("\n"); + sb.append(" taxRate: ").append(this.taxRate).append("\n"); + sb.append(" displayName: ").append(this.displayName).append("\n"); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/Splashscreen.java b/app/src/main/java/com/pb/nex26dv/shippingapp/Splashscreen.java new file mode 100755 index 0000000..7707451 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/Splashscreen.java @@ -0,0 +1,71 @@ +package com.pb.nex26dv.shippingapp; + +/** + * Created by NEX26DV on 12/15/2016. + */ + +import android.app.Activity; +import android.content.Intent; +import android.graphics.PixelFormat; +import android.os.Bundle; +import android.view.Window; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.widget.ImageView; +import android.widget.LinearLayout; + +public class Splashscreen extends Activity { + public void onAttachedToWindow() { + super.onAttachedToWindow(); + Window window = getWindow(); + window.setFormat(PixelFormat.RGBA_8888); + } + /** Called when the activity is first created. */ + Thread splashTread; + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_splashscreen); + StartAnimations(); + } + private void StartAnimations() { + Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha); + anim.reset(); + LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay); + l.clearAnimation(); + l.startAnimation(anim); + + anim = AnimationUtils.loadAnimation(this, R.anim.translate); + anim.reset(); + ImageView iv = (ImageView) findViewById(R.id.splash); + iv.clearAnimation(); + iv.startAnimation(anim); + + splashTread = new Thread() { + @Override + public void run() { + try { + int waited = 0; + // Splash screen pause time + while (waited < 3500) { + sleep(100); + waited += 100; + } + Intent intent = new Intent(Splashscreen.this, + loginActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); + startActivity(intent); + Splashscreen.this.finish(); + } catch (InterruptedException e) { + // do nothing + } finally { + Splashscreen.this.finish(); + } + + } + }; + splashTread.start(); + + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/Utility.java b/app/src/main/java/com/pb/nex26dv/shippingapp/Utility.java new file mode 100755 index 0000000..3a3a1ea --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/Utility.java @@ -0,0 +1,77 @@ +package com.pb.nex26dv.shippingapp; + +import android.Manifest; +import android.app.Activity; +//import android.app.AlertDialog; +import android.content.DialogInterface; +import android.os.Build; +import android.support.v4.app.ActivityCompat; +import android.Manifest; +import android.annotation.TargetApi; +import android.app.Activity; +import android.content.Context; +import android.content.DialogInterface; +import android.content.pm.PackageManager; +import android.os.Build; +import android.support.v4.app.ActivityCompat; +import android.support.v4.content.ContextCompat; +import android.support.v7.app.AlertDialog; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Created by NEX9ZKA on 12/7/2016. + */ + +public class Utility { + private static Pattern pattern; + private static Matcher matcher; + + private static final String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; + + public static boolean validate(String email) { + pattern = Pattern.compile(EMAIL_PATTERN); + matcher = pattern.matcher(email); + return matcher.matches(); + + } + + public static boolean isNotNull(String txt) { + return txt != null && txt.trim().length() > 0 ? true : false; + } +public static final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 123; + + @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + public static boolean checkPermission(final Context context) + { + int currentAPIVersion = Build.VERSION.SDK_INT; + if(currentAPIVersion>= Build.VERSION_CODES.M) + { + if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + if (ActivityCompat.shouldShowRequestPermissionRationale((Activity) context, Manifest.permission.READ_EXTERNAL_STORAGE)) { + AlertDialog.Builder alertBuilder = new AlertDialog.Builder(context); + alertBuilder.setCancelable(true); + alertBuilder.setTitle("Permission necessary"); + alertBuilder.setMessage("External storage permission is necessary"); + alertBuilder.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { + @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + public void onClick(DialogInterface dialog, int which) { + ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE); + } + }); + AlertDialog alert = alertBuilder.create(); + alert.show(); + + } else { + ActivityCompat.requestPermissions((Activity) context, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE); + } + return false; + } else { + return true; + } + } else { + return true; + } + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/WebService/FileDownloader.java b/app/src/main/java/com/pb/nex26dv/shippingapp/WebService/FileDownloader.java new file mode 100755 index 0000000..b863846 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/WebService/FileDownloader.java @@ -0,0 +1,46 @@ +package com.pb.nex26dv.shippingapp.WebService; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; + +/** + * Created by NEX9ZKA on 12/15/2016. + */ + +public class FileDownloader { + private static final int MEGABYTE = 1024 * 1024; + + public static void downloadFile(String fileUrl, File directory) { + try { + + URL url = new URL(fileUrl); + HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); + //urlConnection.setRequestMethod("GET"); + //urlConnection.setDoOutput(true); + urlConnection.connect(); + + InputStream inputStream = urlConnection.getInputStream(); + FileOutputStream fileOutputStream = new FileOutputStream(directory); + int totalSize = urlConnection.getContentLength(); + + byte[] buffer = new byte[MEGABYTE]; + int bufferLength = 0; + while ((bufferLength = inputStream.read(buffer)) > 0) { + fileOutputStream.write(buffer, 0, bufferLength); + } + fileOutputStream.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/WebService/HitWebservice.java b/app/src/main/java/com/pb/nex26dv/shippingapp/WebService/HitWebservice.java new file mode 100755 index 0000000..2895105 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/WebService/HitWebservice.java @@ -0,0 +1,137 @@ +/* +package com.pb.nex26dv.shippingapp.WebService; + +import android.os.AsyncTask; +import android.util.Log; + +import com.google.gson.Gson; +import com.pb.nex26dv.shippingapp.JsonObjects.Shipment; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.UUID; + +import javax.net.ssl.HttpsURLConnection; + +*/ +/** + * Created by NEX9ZKA on 12/14/2016. + *//* + + +public class HitWebservice extends AsyncTask { + + private String requestJson; + + public void setRequestJson(String requestJson) { + this.requestJson = requestJson; + } + + public Shipment getShipment() { + return shipment; + } + + public void setShipment(Shipment shipment) { + this.shipment = shipment; + } + + private Shipment shipment; + + @Override + protected String doInBackground(Void... params) { + HttpURLConnection urlConnection; + + String url = "http://10.50.14.2:8181/services/v1/shipments/create"; + UUID uid = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d"); + String randomUid = uid.randomUUID().toString(); +// String url = "http://10.220.66.60:5000/getDim"; +// String url = "http://10.50.14.2:8181/services/v1/shipments/create"; + // String data = SyncStateContract.Constants.jsonobj; + String data = requestJson; + String result = null; + try { + //Connect + urlConnection = (HttpURLConnection) ((new URL(url).openConnection())); + urlConnection.setDoOutput(true); + urlConnection.setRequestProperty("Content-Type", "application/json"); + urlConnection.setRequestProperty("Accept", "application/json"); + urlConnection.setRequestProperty("Accept-Language", "en-US"); + urlConnection.setRequestProperty("X-PB-TransactionId", randomUid); + + urlConnection.setRequestProperty("Authorization", "Basic Z3BwOmdwcA=="); + urlConnection.setRequestMethod("POST"); + + urlConnection.setConnectTimeout(1000); + urlConnection.connect(); + + */ +/* Gson gson = new Gson(); + + *//* +*/ +/*request.header("X-PB-TransactionId", uid.randomUUID()); + request.header("Accept-Language", "en-US"); + request.header("Authorization", "Basic Z3BwOmdwcA==");*//* +*/ +/* + clientResponse = request.post(); + responseStr = (String) clientResponse.getEntity(String.class);*//* + + + //Write + OutputStream outputStream = urlConnection.getOutputStream(); + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outputStream, "UTF-8")); + writer.write(data); + writer.close(); + outputStream.close(); + + int responseCode = urlConnection.getResponseCode(); + if (responseCode == HttpsURLConnection.HTTP_OK || responseCode == HttpsURLConnection.HTTP_CREATED) { + System.err.println("EVERYTHING IS OK"); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream(), "UTF-8")); + + String line = null; + StringBuilder sb = new StringBuilder(); + + while ((line = bufferedReader.readLine()) != null) { + sb.append(line); + } + + bufferedReader.close(); + result = sb.toString(); + } + + //Read + + + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return result; + } + + @Override + protected void onPostExecute(String s) { + super.onPostExecute(s); + Gson gson = new Gson(); + shipment = gson.fromJson(s, Shipment.class); + System.out.println(shipment); + */ +/*p + output.setText(s);*//* + +// requestJson = s; +// Log.i("JSON", s); + } + +} +*/ diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/conformationpage.java b/app/src/main/java/com/pb/nex26dv/shippingapp/conformationpage.java new file mode 100755 index 0000000..2216229 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/conformationpage.java @@ -0,0 +1,13 @@ +package com.pb.nex26dv.shippingapp; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; + +public class conformationpage extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_conformationpage); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/loginActivity.java b/app/src/main/java/com/pb/nex26dv/shippingapp/loginActivity.java new file mode 100755 index 0000000..bf764b3 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/loginActivity.java @@ -0,0 +1,69 @@ +package com.pb.nex26dv.shippingapp; + +import android.content.Intent; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.Toast; + +public class loginActivity extends AppCompatActivity { + private static Button login_button; + DBHelper helper = new DBHelper(this); +// private static Button register_button; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_login); + + String userID = getIntent().getStringExtra("email"); + + EditText editText = (EditText) findViewById(R.id.login_Email); + editText.setText(userID); + //OnClickButtonListener_member(); + } + + + /* public void OnClickButtonListener_member() { + + login_button = (Button) findViewById(R.id.Login_button); + login_button.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent("com.pb.nex26dv.shippingapp.nva_drawer"); + startActivity(intent); + } + } + ); + }*/ + + public void onSignUpButtonClick(View view) { + if (view.getId() == R.id.signupbutton) { + Intent intent = new Intent(loginActivity.this, registration.class); + startActivity(intent); + } + } + + public void onLoginButtonClick(View view) { + if (view.getId() == R.id.Login_button) { + EditText loginMail = (EditText) findViewById(R.id.login_Email); + EditText loginPassword = (EditText) findViewById(R.id.login_Pass); + + String emailID = loginMail.getText().toString(); + String password = loginPassword.getText().toString(); + + String DBPassword = helper.searchPass(emailID); + + if (DBPassword.equals(password)) { + Intent intent = new Intent(loginActivity.this, main_home_page.class); + startActivity(intent); + } else { + Toast wrongPass = Toast.makeText(this, "Username and password don't match", Toast.LENGTH_SHORT); + wrongPass.show(); + } + } + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/main_display_page.java b/app/src/main/java/com/pb/nex26dv/shippingapp/main_display_page.java new file mode 100755 index 0000000..86d17a2 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/main_display_page.java @@ -0,0 +1,110 @@ +package com.pb.nex26dv.shippingapp; + + +import android.content.Intent; +import android.os.Bundle; +import android.os.StrictMode; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageButton; + + +/** + * A simple {@link Fragment} subclass. + */ +public class main_display_page extends Fragment { + private View v; + private static ImageButton shipping_button; + private static ImageButton saved_item_button; + private static ImageButton myorder_button; + private static Button try_button; + + + public main_display_page() { + // Required empty public constructor + } + + + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); + StrictMode.setVmPolicy(builder.build()); + v = inflater.inflate(R.layout.fragment_main_display_page, container, false); + OnClickButtonListener_shipping_button(); + OnClickButtonListener_saved_item_button(); + OnClickButtonListener_myorder_button(); +// OnClickButtonListener_try_button(); + return v; + + } + + + + public void OnClickButtonListener_shipping_button() + { + + shipping_button = (ImageButton) v.findViewById(R.id.shipping_home_image_button); + shipping_button.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(getActivity(), shipping_order_page.class); + startActivity(intent); + } + } + ); + } + +// public void OnClickButtonListener_try_button() +// { +// +// try_button = (Button) v.findViewById(R.id.trybutton); +// try_button.setOnClickListener( +// new View.OnClickListener() { +// @Override +// public void onClick(View v) { +// Intent intent = new Intent("com.pb.nex26dv.shippingapp.shipping_order_page"); +// startActivity(intent); +// } +// } +// ); +// } + + public void OnClickButtonListener_saved_item_button() + { + + saved_item_button = (ImageButton) v.findViewById(R.id.saved_items_home_image_button); + saved_item_button.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent("com.pb.nex26dv.shippingapp.wishlist"); + startActivity(intent); + } + } + ); + } + + public void OnClickButtonListener_myorder_button() + { + + myorder_button = (ImageButton) v.findViewById(R.id.myorder_home_image_button); + myorder_button.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent("com.pb.nex26dv.shippingapp.myorder_frag"); + startActivity(intent); + } + } + ); + } + + +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/main_home_page.java b/app/src/main/java/com/pb/nex26dv/shippingapp/main_home_page.java new file mode 100755 index 0000000..ffcb7f4 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/main_home_page.java @@ -0,0 +1,79 @@ +package com.pb.nex26dv.shippingapp; + +import android.content.Intent; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.ImageButton; + +//import static com.pb.nex26dv.shippingapp.R.id.myorder_image_button; +//import static com.pb.nex26dv.shippingapp.R.id.order_submit; +//import static com.pb.nex26dv.shippingapp.R.id.savedorders_image_button; + +public class main_home_page extends AppCompatActivity { + + private static ImageButton shipping_button; + private static ImageButton myorder_button; + private static ImageButton saved_button; + private static ImageButton info_button; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main_home_page); + OnClickButtonListener_shipping(); +// OnClickButtonListener_myorder(); +// OnClickButtonListener_saved(); +// OnClickButtonListener_info(); + +} + + public void OnClickButtonListener_shipping() + { + + shipping_button = (ImageButton)findViewById(R.id.shipping_image_button); + shipping_button.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent("com.pb.nex26dv.shippingapp.orderplacing"); + startActivity(intent); + } + } + ); + } + +// public void OnClickButtonListener_myorder() +// { +// +// myorder_button = (ImageButton)findViewById(R.id.myorder_image_button); +// myorder_button.setOnClickListener( +// new View.OnClickListener() { +// @Override +// public void onClick(View v) { +// Intent intent = new Intent("com.pb.nex26dv.shippingapp.myorders"); +// startActivity(intent); +// } +// } +// ); +// } + +// public void OnClickButtonListener_saved() +// { +// +// saved_button = (ImageButton)findViewById(R.id.savedorders_image_button); +// saved_button.setOnClickListener( +// new View.OnClickListener() { +// @Override +// public void onClick(View v) { +// Intent intent = new Intent("com.pb.nex26dv.shippingapp.wishlist"); +// startActivity(intent); +// } +// } +// ); +// } + + + +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/mapper/ShipmentMapper.java b/app/src/main/java/com/pb/nex26dv/shippingapp/mapper/ShipmentMapper.java new file mode 100755 index 0000000..662201b --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/mapper/ShipmentMapper.java @@ -0,0 +1,179 @@ +package com.pb.nex26dv.shippingapp.mapper; + +import com.google.gson.Gson; +import com.pb.nex26dv.shippingapp.JsonObjects.Address; +import com.pb.nex26dv.shippingapp.JsonObjects.CarrierAccount; +import com.pb.nex26dv.shippingapp.JsonObjects.CarrierPayment; +import com.pb.nex26dv.shippingapp.JsonObjects.Document; +import com.pb.nex26dv.shippingapp.JsonObjects.Parameter; +import com.pb.nex26dv.shippingapp.JsonObjects.Parcel; +import com.pb.nex26dv.shippingapp.JsonObjects.ParcelDimension; +import com.pb.nex26dv.shippingapp.JsonObjects.ParcelWeight; +import com.pb.nex26dv.shippingapp.JsonObjects.Rate; +import com.pb.nex26dv.shippingapp.JsonObjects.Shipment; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by NEX9ZKA on 12/14/2016. + */ + +public class ShipmentMapper { + private Shipment shipment; + + public Shipment getShipment() { + return shipment; + } + + public ShipmentMapper() { + this.shipment = new Shipment(); + } + + public Address setAddress(String email, String name,String stateProvince, String cityTown, String company, String countryCode, String phone, String postalCode, String taxId, String addresslines) { + Address address = new Address(); + address.setName(name); + address.setStateProvince(stateProvince); + address.setCityTown(cityTown.toUpperCase()); + address.setEmail(email); + address.setCompany(company); + address.setCountryCode(countryCode.toUpperCase()); + address.setPhone(phone); + address.setPostalCode(postalCode.toUpperCase()); + address.setStatus(Address.StatusEnum.PARSED); + address.setResidential(Boolean.FALSE); + address.setTaxId(taxId); + address.getAddressLines().add(addresslines); + return address; + /* address.getAddressLines().add(addresslines[1]); + address.getAddressLines().add(addresslines[2]);*/ + } + + public Parcel mapParcel(double height, double irregularParcelGirth, double length, double width, double weight) { + Parcel parcel = new Parcel(); + ParcelDimension parcelDimension = new ParcelDimension(); + ParcelWeight parcelWeight = new ParcelWeight(); + + parcelWeight.setUnitOfMeasurement(ParcelWeight.UnitOfMeasurementEnum.OZ); + parcelWeight.setWeight(weight); + parcel.setWeight(parcelWeight); + + parcelDimension.setHeight(height); + parcelDimension.setIrregularParcelGirth(irregularParcelGirth); + parcelDimension.setLength(length); + parcelDimension.setWidth(width); + parcelDimension.setUnitOfMeasurement(ParcelDimension.UnitOfMeasurementEnum.IN); + parcel.setDimension(parcelDimension); + + return parcel; + } + + public List mapRates(String carrier, String serviceId, String parceltype, String rateTypeId, String inductionPostalCode) { + List rateList = new ArrayList<>(); + Rate rate = new Rate(); + rate.setCarrier(carrier); + rate.setServiceId(serviceId); + rate.setParcelType(parceltype); + rate.setRateTypeId(rateTypeId); + rate.setInductionPostalCode(inductionPostalCode); + + rateList.add(rate); + + return rateList; + } + + public List mapDocuments() { + List documentList = new ArrayList<>(); + Document document = new Document(); + document.setType(Document.TypeEnum.SHIPPING_LABEL); + document.setPrintDialogOption(Document.PrintDialogOptionEnum.EMBED_PRINT_DIALOG); + document.setSize(Document.SizeEnum.DOC_4X6); + document.setFileFormat(Document.FileFormatEnum.PDF); + document.setContentType(Document.ContentTypeEnum.URL); + + documentList.add(document); + return documentList; + } + + public List mapCarrierAccounts() { + List carrierAccounts = new ArrayList<>(); + CarrierAccount carrierAccount = new CarrierAccount(); + Parameter parameter1 = new Parameter(); + Parameter parameter2 = new Parameter(); + Parameter parameter3 = new Parameter(); + Parameter parameter4 = new Parameter(); + Parameter parameter5 = new Parameter(); + +// parameter1.setName("USER_ID"); +// parameter1.setValue("i3EaqJaRVzq2T87r"); +// ; +// parameter2.setName("PASSWORD"); +// parameter2.setValue("lGe1PZeDmNCgoZEq40Z6m9i5n"); + +// parameter3.setName("METER_NUMBER"); +// parameter3.setValue("118817536"); +// +// parameter4.setName("ACCOUNT_NUMBER"); +// parameter4.setValue("602684342"); + + parameter5.setName("DIE_NUMBER"); + parameter5.setValue("12121"); + +// carrierAccount.getParameters().add(parameter1); +// carrierAccount.getParameters().add(parameter2); +// carrierAccount.getParameters().add(parameter3); +// carrierAccount.getParameters().add(parameter4); + carrierAccount.getParameters().add(parameter5); + + carrierAccounts.add(carrierAccount); + return carrierAccounts; + } + + public List mapCarrierPayment() { + List carrierPaymentList = new ArrayList<>(); + CarrierPayment carrierPayment = new CarrierPayment(); + carrierPayment.setAccountNumber("602684342"); + carrierPayment.setParty(CarrierPayment.PartyEnum.BILL_SENDER); + carrierPayment.setTypeOfCharge(CarrierPayment.TypeOfChargeEnum.TRANSPORTATION_CHARGES); + carrierPayment.setPostalCode("14609"); + carrierPayment.setCountryCode("US"); + + carrierPaymentList.add(carrierPayment); + return carrierPaymentList; + } + + public List mapShipmentOption(String futureShipmentDate) { + List parameterList = new ArrayList<>(); + Parameter parameter1 = new Parameter(); + Parameter parameter2 = new Parameter(); + Parameter parameter3 = new Parameter(); + Parameter parameter4 = new Parameter(); + Parameter parameter5 = new Parameter(); + + parameter1.setName("AUTH_CODE"); + parameter1.setValue("auth code"); + parameter2.setName("AUTH_TIME_STAMP"); + parameter2.setValue("2017-06-30 12:12:12"); +// parameter3.setName("PRINT_INVOICE_NUMBER"); +// parameter3.setValue("invoice XXXXXXx"); +// parameter4.setName("FUTURE_SHIPMENT_DATE"); +// parameter4.setValue(futureShipmentDate); +// parameter5.setName("PRINT_PO_NUMBER"); +// parameter5.setValue("PO XXXXXXx"); + + parameterList.add(parameter1); + parameterList.add(parameter2); +// parameterList.add(parameter3); +// parameterList.add(parameter4); +// parameterList.add(parameter5); + + return parameterList; + } + + public String convertShipmentToJson(Shipment shipment) { + Gson gson = new Gson(); + String JSONString = gson.toJson(shipment); + return JSONString; + } + +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/myorder_frag.java b/app/src/main/java/com/pb/nex26dv/shippingapp/myorder_frag.java new file mode 100755 index 0000000..ae7abae --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/myorder_frag.java @@ -0,0 +1,29 @@ +package com.pb.nex26dv.shippingapp; + + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + + +/** + * A simple {@link Fragment} subclass. + */ +public class myorder_frag extends Fragment { + + + public myorder_frag() { + // Required empty public constructor + } + + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_myorder_frag, container, false); + } + +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/myorders.java b/app/src/main/java/com/pb/nex26dv/shippingapp/myorders.java new file mode 100755 index 0000000..185f9e5 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/myorders.java @@ -0,0 +1,13 @@ +package com.pb.nex26dv.shippingapp; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; + +public class myorders extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_myorders); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/nva_drawer.java b/app/src/main/java/com/pb/nex26dv/shippingapp/nva_drawer.java new file mode 100755 index 0000000..7bd3ffc --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/nva_drawer.java @@ -0,0 +1,128 @@ +package com.pb.nex26dv.shippingapp; + +import android.os.Bundle; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.Snackbar; +import android.view.View; +import android.support.design.widget.NavigationView; +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 nva_drawer extends AppCompatActivity + implements NavigationView.OnNavigationItemSelectedListener { + + NavigationView navigationView = null; + Toolbar toolbar =null; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_nva_drawer); + + //set the fragment + main_display_page fragment = new main_display_page(); + android.support.v4.app.FragmentTransaction fragmentTransaction = + getSupportFragmentManager().beginTransaction(); + fragmentTransaction.replace(R.id.fragment_container, fragment); + fragmentTransaction.commit(); + + toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) + .setAction("Action", null).show(); + } + }); + + DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( + this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); + drawer.setDrawerListener(toggle); + toggle.syncState(); + + navigationView = (NavigationView) findViewById(R.id.nav_view); + navigationView.setNavigationItemSelectedListener(this); + } + + @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.nva_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); + } + + @SuppressWarnings("StatementWithEmptyBody") + @Override + public boolean onNavigationItemSelected(MenuItem item) { + // Handle navigation view item clicks here. + int id = item.getItemId(); + + if (id == R.id.nav_camera) { + // Handle the camera action + main_display_page fragment = new main_display_page(); + android.support.v4.app.FragmentTransaction fragmentTransaction = + getSupportFragmentManager().beginTransaction(); + fragmentTransaction.replace(R.id.fragment_container, fragment); + fragmentTransaction.commit(); + } else if (id == R.id.nav_gallery) { + shipping_order_page fragment = new shipping_order_page(); + android.support.v4.app.FragmentTransaction fragmentTransaction = + getSupportFragmentManager().beginTransaction(); + fragmentTransaction.replace(R.id.fragment_container, fragment); + fragmentTransaction.commit(); + + } else if (id == R.id.nav_slideshow) { + + myorder_frag fragment = new myorder_frag(); + android.support.v4.app.FragmentTransaction fragmentTransaction = + getSupportFragmentManager().beginTransaction(); + fragmentTransaction.replace(R.id.fragment_container, fragment); + fragmentTransaction.commit(); + + } else if (id == R.id.nav_manage) { + + } else if (id == R.id.nav_share) { + + } else if (id == R.id.nav_send) { + + } + + DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + drawer.closeDrawer(GravityCompat.START); + return true; + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/orderplacing.java b/app/src/main/java/com/pb/nex26dv/shippingapp/orderplacing.java new file mode 100755 index 0000000..be16cc1 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/orderplacing.java @@ -0,0 +1,566 @@ +package com.pb.nex26dv.shippingapp; + +import android.app.Activity; +import android.content.ActivityNotFoundException; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.graphics.Bitmap; +import android.net.Uri; +import android.os.AsyncTask; +import android.os.Bundle; +import android.os.Environment; +import android.os.StrictMode; +import android.provider.MediaStore; +import android.support.v7.app.AlertDialog; +import android.support.v7.app.AppCompatActivity; +import android.util.Base64; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import com.google.gson.Gson; +import com.pb.nex26dv.shippingapp.JsonObjects.Shipment; +import com.pb.nex26dv.shippingapp.WebService.FileDownloader; +import com.pb.nex26dv.shippingapp.mapper.ShipmentMapper; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.math.BigDecimal; +import java.net.HttpURLConnection; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +import javax.net.ssl.HttpsURLConnection; + +import static com.pb.nex26dv.shippingapp.R.id.add_cart; +import static com.pb.nex26dv.shippingapp.R.id.order_cancel; +import static com.pb.nex26dv.shippingapp.R.id.order_submit; + +public class orderplacing extends AppCompatActivity { + private static Button submit_button; + private static Button addtocart; + private static Button cancel_order; + private static Button back_button; + private Button btnSelect; + private String JSONString; + EditText senderName; + EditText senderMobile; + EditText senderPostalAddress; + EditText senderPostalCode; + EditText senderCountryCode; + EditText receiverName; + EditText receiverMobile; + EditText receiverPostalAddress; + EditText receiverPostalCode; + EditText weight; + EditText receiverCountryCode; + EditText length; + EditText height; + EditText width; + private String userChoosenTask; + private int REQUEST_CAMERA = 0, SELECT_FILE = 1; + + String firstResponse = null; + String secondResponse = null; + + float l, b, h, tmp; + + @Override + protected void onCreate(Bundle savedInstanceState) { + StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); + StrictMode.setVmPolicy(builder.build()); + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_orderplacing); + if (android.os.Build.VERSION.SDK_INT > 9) { + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); + StrictMode.setThreadPolicy(policy); + } + OnClickButtonListener_submit(); +// OnClickButtonListener_addtocart(); +// OnClickButtonListener_cancel_order(); +// OnClickButtonListener_back_button(); +// btnSelect = (Button) findViewById(R.id.order_camer_button); +// btnSelect.setOnClickListener(new View.OnClickListener() { +// +// @Override +// public void onClick(View v) { +// selectImage(); +// } +// }); + + senderName = (EditText) findViewById(R.id.senderEditText); + senderMobile = (EditText) findViewById(R.id.sMobileEditText); + senderPostalAddress = (EditText) findViewById(R.id.sPostalAddressEditText); + senderPostalCode = (EditText) findViewById(R.id.sPostalCodeEditText); + senderCountryCode = (EditText) findViewById(R.id.sCountryCodeEditText); + receiverName = (EditText) findViewById(R.id.rNameEditText); + receiverMobile = (EditText) findViewById(R.id.rMobileEditText); + receiverPostalAddress = (EditText) findViewById(R.id.rPostalAddressEditText); + receiverPostalCode = (EditText) findViewById(R.id.rPostalCodeEditText); + weight = (EditText) findViewById(R.id.weightEditText); + receiverCountryCode = (EditText) findViewById(R.id.rCountryCodeEditText); + length = (EditText) findViewById(R.id.lengthEditText); + height = (EditText) findViewById(R.id.heightEditText); + width = (EditText) findViewById(R.id.widthEditText); + + } + +// @Override +// public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { +// switch (requestCode) { +// case Utility.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE: +// if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { +// if (userChoosenTask.equals("Take Photo For Dimension")) +// cameraIntent(); +// else if (userChoosenTask.equals("Choose from Library")) +// galleryIntent(); +// } else { +// //code for deny +// } +// break; +// } +// } + +// private void selectImage() { +// final CharSequence[] items = {"Take Photo", "Choose from Library", +// "Cancel"}; +// +// AlertDialog.Builder builder = new AlertDialog.Builder(orderplacing.this); +// builder.setTitle("Add Photo!"); +// builder.setItems(items, new DialogInterface.OnClickListener() { +// @Override +// public void onClick(DialogInterface dialog, int item) { +// //boolean result=Utility.checkPermission(orderplacing.this); +// boolean result = true; +// +// if (items[item].equals("Take Photo")) { +// userChoosenTask = "Take Photo"; +// if (result) +// cameraIntent(); +// +// } else if (items[item].equals("Choose from Library")) { +// userChoosenTask = "Choose from Library"; +// if (result) +// galleryIntent(); +// +// } else if (items[item].equals("Cancel")) { +// dialog.dismiss(); +// } +// } +// }); +// builder.show(); +// } + + private void galleryIntent() { + Intent intent = new Intent(); + intent.setType("image/*"); + intent.setAction(Intent.ACTION_GET_CONTENT);// + startActivityForResult(Intent.createChooser(intent, "Select File"), SELECT_FILE); + } + +// private void cameraIntent() { +// Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); +// startActivityForResult(intent, REQUEST_CAMERA); +// } + +// @Override +// public void onActivityResult(int requestCode, int resultCode, Intent data) { +// super.onActivityResult(requestCode, resultCode, data); +// +// if (resultCode == Activity.RESULT_OK) { +// if (requestCode == SELECT_FILE) +// onSelectFromGalleryResult(data); +// else if (requestCode == REQUEST_CAMERA) +// onCaptureImageResult(data); +// } +// } + +// private void onCaptureImageResult(Intent data) { +// Bitmap thumbnail = (Bitmap) data.getExtras().get("data"); +// Bitmap scaled = Bitmap.createScaledBitmap(thumbnail, 600, 450, false); +// +// ByteArrayOutputStream bytes = new ByteArrayOutputStream(); +// scaled.compress(Bitmap.CompressFormat.JPEG, 100, bytes); +// String encoded = Base64.encodeToString(bytes.toByteArray(), Base64.DEFAULT); +// String response = makeDimPostCall(encoded); +// +// if (firstResponse == null) { +// firstResponse = response; +// cameraIntent(); +// Toast.makeText(getApplicationContext(), "Please snap second picture for full dimention", Toast.LENGTH_LONG).show(); +// +// } else { +// secondResponse = response; +// +// } +// +// List finDim = getFinalDimList(); +// if (finDim != null && finDim.size() >= 3) { +// EditText editTexHeight = (EditText) findViewById(R.id.heightEditText); +// EditText editTexWid = (EditText) findViewById(R.id.widthEditText); +// EditText editTexLen = (EditText) findViewById(R.id.lengthEditText); +// editTexLen.setText(round(finDim.get(0), 2), TextView.BufferType.EDITABLE); +// editTexWid.setText(round(finDim.get(1), 2), TextView.BufferType.EDITABLE); +// editTexHeight.setText(round(finDim.get(2), 2), TextView.BufferType.EDITABLE); +// } +// +// +// } + + public void OnClickButtonListener_submit() { + + submit_button = (Button) findViewById(order_submit); + submit_button.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + JSONString = mapShipmentOnButtonClick(); + HitWebservice hitWebservice = new HitWebservice(); + hitWebservice.execute(); + + /*Intent intent = new Intent("com.pb.nex26dv.shippingapp.conformationpage"); + startActivity(intent);*/ + } + } + ); + } + + +// public void OnClickButtonListener_addtocart() { +// +//// System.err.println("EVERYTHING IS OK ADD TO CART"); +// +// +//// Toast.makeText(orderplacing.this, "Not Available addto cart", Toast.LENGTH_LONG).show(); +// +//// addtocart = (Button) findViewById(add_cart); +//// addtocart.setOnClickListener( +//// new View.OnClickListener() { +//// @Override +//// public void onClick(View v) { +//// Intent intent = new Intent("com.pb.nex26dv.shippingapp.wishlist"); +//// startActivity(intent); +//// } +//// } +//// ); +// } + + +// public void OnClickButtonListener_cancel_order() { +// +//// System.err.println("EVERYTHING IS OK CANCEL"); +// +//// Toast.makeText(orderplacing.this, "Not Available cancel", Toast.LENGTH_LONG).show(); +// +//// cancel_order = (Button) findViewById(order_cancel); +//// cancel_order.setOnClickListener( +//// new View.OnClickListener() { +//// @Override +//// public void onClick(View v) { +//// Intent intent = new Intent("com.pb.nex26dv.shippingapp.loginActivity"); +//// startActivity(intent); +//// } +//// } +//// ); +// } + + + /*public void OnClickButtonListener_back_button() { + + back_button = (Button) findViewById(backbutton); + back_button.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent("com.pb.nex26dv.shippingapp.loginActivity"); + startActivity(intent); + } + } + ); + }*/ + + + @SuppressWarnings("deprecation") + private void onSelectFromGalleryResult(Intent data) { + + Bitmap bm = null; + if (data != null) { + try { + bm = MediaStore.Images.Media.getBitmap(getApplicationContext().getContentResolver(), data.getData()); + + } catch (IOException e) { + e.printStackTrace(); + } + } + + //ivImage.setImageBitmap(bm); + } + + public String mapShipmentOnButtonClick() { + SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd"); + Date date = new Date(); + ShipmentMapper shipmentMapper = new ShipmentMapper(); + Shipment shipment = shipmentMapper.getShipment(); +//Keep postalcode = L4W5K6 and country code = CA + shipment.setFromAddress(shipmentMapper.setAddress("john.publica@pb.com", senderName.getText().toString(), "NONE", "NONE", "PitneyBowes", senderCountryCode.getText().toString(), senderMobile.getText().toString(), senderPostalCode.getText().toString(), "TaxID", senderPostalAddress.getText().toString())); + shipment.setToAddress(shipmentMapper.setAddress("rs.canid@gmail.com", receiverName.getText().toString(), "NONE", "NONE", "PitneyBowes", receiverCountryCode.getText().toString(), receiverMobile.getText().toString(), receiverPostalCode.getText().toString(), "TaxID", receiverPostalAddress.getText().toString())); + shipment.setCarrierPayments(shipmentMapper.mapCarrierPayment()); + shipment.setCarrierAccounts(shipmentMapper.mapCarrierAccounts()); + shipment.setParcel(shipmentMapper.mapParcel(Double.valueOf(height.getText().toString()), 12.33, Double.valueOf(length.getText().toString()), Double.valueOf(width.getText().toString()), Double.valueOf(weight.getText().toString()))); + shipment.setShipmentOptions(shipmentMapper.mapShipmentOption(dateFormatter.format(date))); + shipment.setDocuments(shipmentMapper.mapDocuments()); + shipment.setRates(shipmentMapper.mapRates("rmg", "NDA", "SMALL_EXP_BOX", "COMMERCIAL", "B12 0TA")); + + return shipmentMapper.convertShipmentToJson(shipment); + + } + + private class HitWebservice extends AsyncTask { + @Override + protected String doInBackground(Void... params) { + HttpURLConnection urlConnection; + + String url = "https://sandbox2-gcs-ecommerce.test.pb.com/services/v1/shipments/create"; + UUID uid = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d"); + String randomUid = uid.randomUUID().toString(); + + String data = JSONString; + String result = null; + try { + //Connect + urlConnection = (HttpURLConnection) ((new URL(url).openConnection())); + urlConnection.setDoOutput(true); + urlConnection.setRequestProperty("Content-Type", "application/json"); + urlConnection.setRequestProperty("Accept", "application/json"); + urlConnection.setRequestProperty("Accept-Language", "en-GB"); + urlConnection.setRequestProperty("X-PB-TransactionId", randomUid); + urlConnection.setRequestProperty("X-PB-PartnerId", "456312111"); + + urlConnection.setRequestProperty("Authorization", "Basic YzYzYWIzZWFhOTFlZTY3NTkxMTQ6YzJkNWFhOWYxZTJkYmNlZWE4MTY="); + urlConnection.setRequestMethod("POST"); + +// urlConnection.setConnectTimeout(1000); + urlConnection.connect(); + + //Write + OutputStream outputStream = urlConnection.getOutputStream(); + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outputStream, "UTF-8")); + writer.write(data); + writer.close(); + outputStream.close(); + + int responseCode = urlConnection.getResponseCode(); + if (responseCode == HttpsURLConnection.HTTP_OK || responseCode == HttpsURLConnection.HTTP_CREATED) { + System.err.println("EVERYTHING IS OK"); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream(), "UTF-8")); + + String line = null; + StringBuilder sb = new StringBuilder(); + + while ((line = bufferedReader.readLine()) != null) { + sb.append(line); + } + + bufferedReader.close(); + result = sb.toString(); + } + + + //Read + + + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); +// Toast.makeText(orderplacing.this, "Invalid Request", Toast.LENGTH_LONG).show(); + } + return result; + } + + @Override + protected void onPostExecute(String s) { + super.onPostExecute(s); + Intent intent = new Intent("com.pb.nex26dv.shippingapp.conformationpage"); + if (s == null){ + Toast.makeText(orderplacing.this, "Bad Request", Toast.LENGTH_SHORT).show(); + finish(); + }else{ + + Gson gson = new Gson(); + Shipment shipment = gson.fromJson(s, Shipment.class); + + download(shipment.getDocuments().get(0).getContents()); + Log.i("JSON", s); + Log.i("URL", shipment.getDocuments().get(0).getContents()); + intent.putExtra("labelurl", shipment.getDocuments().get(0).getContents()); + } + + + } + } + + public void download(String URL) { + new DownloadFile().execute(URL, "label.pdf"); + } + + public void view(View view) { + File pdfFile = new File(Environment.getExternalStorageDirectory() + "/label/" + "label.pdf"); // -> filename = maven.pdf + Uri path = Uri.fromFile(pdfFile); + Intent pdfIntent = new Intent(Intent.ACTION_VIEW); + pdfIntent.setDataAndType(path, "application/pdf"); + pdfIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + + try { + startActivity(pdfIntent); + } catch (ActivityNotFoundException e) { + Toast.makeText(orderplacing.this, "No Application available to view PDF", Toast.LENGTH_SHORT).show(); + } + } + + private class DownloadFile extends AsyncTask { + + @Override + protected void onPreExecute() { + super.onPreExecute(); + senderName.setEnabled(false); + senderMobile.setEnabled(false); + senderPostalAddress.setEnabled(false); + senderPostalCode.setEnabled(false); + senderCountryCode.setEnabled(false); + receiverName.setEnabled(false); + receiverMobile.setEnabled(false); + receiverPostalAddress.setEnabled(false); + receiverPostalCode.setEnabled(false); + weight.setEnabled(false); + receiverCountryCode.setEnabled(false); + length.setEnabled(false); + height.setEnabled(false); + width.setEnabled(false); + } + + @Override + protected Void doInBackground(String... strings) { + String fileUrl = strings[0]; // -> http://10.50.14.48/fedex/187143416/outbound/label/f9102b14a5c74c3f8d57ed41568d45d0.pdf + String fileName = strings[1]; // -> label.pdf + String extStorageDirectory = Environment.getExternalStorageDirectory().toString(); + File folder = new File(extStorageDirectory, "/label"); + folder.mkdir(); + + File pdfFile = new File(folder, fileName); + + try { + pdfFile.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + FileDownloader.downloadFile(fileUrl, pdfFile); + return null; + } + + @Override + protected void onPostExecute(Void aVoid) { + super.onPostExecute(aVoid); + Toast.makeText(orderplacing.this, "Label downloaded successfully", Toast.LENGTH_SHORT).show(); + } + } + + private String makeDimPostCall(String requestData) { + HttpURLConnection httpcon; + String url = "http://10.220.66.60:5000/getDim"; + String data = null; + String result = null; + try { + //Connect + httpcon = (HttpURLConnection) ((new URL(url).openConnection())); + httpcon.setDoOutput(true); + httpcon.setRequestProperty("Content-Type", "application/json"); + //httpcon.setRequestProperty("Accept", "application/json"); + httpcon.setRequestMethod("POST"); + httpcon.connect(); + + //Write + OutputStream os = httpcon.getOutputStream(); + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, "UTF-8")); + writer.write(requestData); + writer.close(); + os.close(); + + //Read + BufferedReader br = new BufferedReader(new InputStreamReader(httpcon.getInputStream(), "UTF-8")); + + String line = null; + StringBuilder sb = new StringBuilder(); + + while ((line = br.readLine()) != null) { + sb.append(line); + } + + br.close(); + result = sb.toString(); + + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return result; + } + + + public List getFinalDimList() { + List dim = new ArrayList<>(); + if (secondResponse != null) { + + l = Float.parseFloat(firstResponse.substring(0, firstResponse.indexOf(','))); + b = Float.parseFloat(firstResponse.substring(firstResponse.indexOf(',') + 1, firstResponse.length() - 1)); + + h = Float.parseFloat(secondResponse.substring(0, secondResponse.indexOf(','))); + tmp = Float.parseFloat(secondResponse.substring(secondResponse.indexOf(',') + 1, secondResponse.length() - 1)); + + dim.add(l); + dim.add(b); + dim.add(h); + dim.add(tmp); + Float min = Float.MAX_VALUE; + for (int i = 0; i < dim.size(); i++) { + for (int j = i + 1; j < dim.size(); j++) { + if (Math.abs(dim.get(i) - dim.get(j)) < min) + min = Math.abs(dim.get(i) - dim.get(j)); + } + } + + for (int i = 0; i < dim.size(); i++) { + for (int j = i + 1; j < dim.size(); j++) { + if (min.equals(Math.abs(dim.get(i) - dim.get(j)))) + dim.remove(j); + } + } + + firstResponse = secondResponse = null; + } + return dim; + } + + public static String round(float d, int decimalPlace) { + BigDecimal bd = new BigDecimal(Float.toString(d)); + bd = bd.setScale(decimalPlace, BigDecimal.ROUND_HALF_UP); + return bd.toString(); + } + +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/orderplacing.java.bak b/app/src/main/java/com/pb/nex26dv/shippingapp/orderplacing.java.bak new file mode 100755 index 0000000..de195d0 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/orderplacing.java.bak @@ -0,0 +1,344 @@ +package com.pb.nex26dv.shippingapp; + +import android.app.Activity; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.graphics.Bitmap; +import android.os.AsyncTask; +import android.os.Environment; +import android.os.StrictMode; +import android.provider.MediaStore; +import android.support.v7.app.AlertDialog; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.util.Base64; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import javax.net.ssl.HttpsURLConnection; + +import static com.pb.nex26dv.shippingapp.R.id.add_cart; +import static com.pb.nex26dv.shippingapp.R.id.addtocart; +import static com.pb.nex26dv.shippingapp.R.id.backbutton; +import static com.pb.nex26dv.shippingapp.R.id.cancel_order; +import static com.pb.nex26dv.shippingapp.R.id.Login_button; +import static com.pb.nex26dv.shippingapp.R.id.order_cancel; +import static com.pb.nex26dv.shippingapp.R.id.order_submit; + +public class orderplacing extends AppCompatActivity { + private static Button submit_button; + private static Button addtocart; + private static Button cancel_order; + private static Button back_button; + private Button btnSelect; + private String userChoosenTask; + private int REQUEST_CAMERA = 0, SELECT_FILE = 1; + + String firstResponse = null; + String secondResponse = null; + + float l, b, h, tmp; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_orderplacing); + if (android.os.Build.VERSION.SDK_INT > 9) { + StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); + StrictMode.setThreadPolicy(policy); + } + OnClickButtonListener_submit(); + OnClickButtonListener_addtocart(); + OnClickButtonListener_cancel_order(); + OnClickButtonListener_back_button(); + btnSelect = (Button) findViewById(R.id.order_camer_button); + btnSelect.setOnClickListener(new View.OnClickListener() { + + @Override + public void onClick(View v) { + selectImage(); + } + }); + + + } + + @Override + public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { + switch (requestCode) { + case Utility.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE: + if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { + if (userChoosenTask.equals("Take Photo For Dimension")) + cameraIntent(); + else if (userChoosenTask.equals("Choose from Library")) + galleryIntent(); + } else { + //code for deny + } + break; + } + } + + private void selectImage() { + final CharSequence[] items = {"Take Photo", "Choose from Library", + "Cancel"}; + + AlertDialog.Builder builder = new AlertDialog.Builder(orderplacing.this); + builder.setTitle("Add Photo!"); + builder.setItems(items, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int item) { + //boolean result=Utility.checkPermission(orderplacing.this); + boolean result = true; + + if (items[item].equals("Take Photo")) { + userChoosenTask = "Take Photo"; + if (result) + cameraIntent(); + + } else if (items[item].equals("Choose from Library")) { + userChoosenTask = "Choose from Library"; + if (result) + galleryIntent(); + + } else if (items[item].equals("Cancel")) { + dialog.dismiss(); + } + } + }); + builder.show(); + } + + private void galleryIntent() { + Intent intent = new Intent(); + intent.setType("image/*"); + intent.setAction(Intent.ACTION_GET_CONTENT);// + startActivityForResult(Intent.createChooser(intent, "Select File"), SELECT_FILE); + } + + private void cameraIntent() { + Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); + startActivityForResult(intent, REQUEST_CAMERA); + } + + @Override + public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + + if (resultCode == Activity.RESULT_OK) { + if (requestCode == SELECT_FILE) + onSelectFromGalleryResult(data); + else if (requestCode == REQUEST_CAMERA) + onCaptureImageResult(data); + } + } + + private void onCaptureImageResult(Intent data) { + Bitmap thumbnail = (Bitmap) data.getExtras().get("data"); + Bitmap scaled = Bitmap.createScaledBitmap(thumbnail, 600, 450, false); + + ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + scaled.compress(Bitmap.CompressFormat.JPEG, 100, bytes); + String encoded = Base64.encodeToString(bytes.toByteArray(), Base64.DEFAULT); + String response = makeDimPostCall(encoded); + + if (firstResponse == null) { + firstResponse = response; + cameraIntent(); + Toast.makeText(getApplicationContext(), "Please snap second picture for full dimention", Toast.LENGTH_LONG).show(); + + } else { + secondResponse = response; + + } + + List finDim = getFinalDimList(); + if (finDim != null && finDim.size() >= 3) { + EditText editTexHeight = (EditText)findViewById(R.id.editTexHeight); + EditText editTexWid = (EditText)findViewById(R.id.editTexWid); + EditText editTexLen = (EditText)findViewById(R.id.editTexLen); + editTexLen.setText(finDim.get(0).toString(), TextView.BufferType.EDITABLE); + editTexWid.setText(finDim.get(1).toString(), TextView.BufferType.EDITABLE); + editTexHeight.setText(finDim.get(2).toString(), TextView.BufferType.EDITABLE); + //todo Sumit: set values in UI + } + + + } + + public void OnClickButtonListener_submit() { + + submit_button = (Button) findViewById(order_submit); + submit_button.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent("com.pb.nex26dv.shippingapp.conformationpage"); + startActivity(intent); + } + } + ); + } + + + public void OnClickButtonListener_addtocart() { + + addtocart = (Button) findViewById(add_cart); + addtocart.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent("com.pb.nex26dv.shippingapp.wishlist"); + startActivity(intent); + } + } + ); + } + + + public void OnClickButtonListener_cancel_order() { + + cancel_order = (Button) findViewById(order_cancel); + cancel_order.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent("com.pb.nex26dv.shippingapp.loginActivity"); + startActivity(intent); + } + } + ); + } + + + public void OnClickButtonListener_back_button() { + + back_button = (Button) findViewById(backbutton); + back_button.setOnClickListener( + new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent("com.pb.nex26dv.shippingapp.loginActivity"); + startActivity(intent); + } + } + ); + } + + + @SuppressWarnings("deprecation") + private void onSelectFromGalleryResult(Intent data) { + + Bitmap bm = null; + if (data != null) { + try { + bm = MediaStore.Images.Media.getBitmap(getApplicationContext().getContentResolver(), data.getData()); + + } catch (IOException e) { + e.printStackTrace(); + } + } + + //ivImage.setImageBitmap(bm); + } + + private String makeDimPostCall(String requestData) { + HttpURLConnection httpcon; + String url = "http://192.168.43.102:5000/getDim"; + String data = null; + String result = null; + try { + //Connect + httpcon = (HttpURLConnection) ((new URL (url).openConnection())); + httpcon.setDoOutput(true); + httpcon.setRequestProperty("Content-Type", "application/json"); + //httpcon.setRequestProperty("Accept", "application/json"); + httpcon.setRequestMethod("POST"); + httpcon.connect(); + + //Write + OutputStream os = httpcon.getOutputStream(); + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, "UTF-8")); + writer.write(requestData); + writer.close(); + os.close(); + + //Read + BufferedReader br = new BufferedReader(new InputStreamReader(httpcon.getInputStream(),"UTF-8")); + + String line = null; + StringBuilder sb = new StringBuilder(); + + while ((line = br.readLine()) != null) { + sb.append(line); + } + + br.close(); + result = sb.toString(); + + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return result; + } + + + + public List getFinalDimList() { + List dim = new ArrayList<>(); + if (secondResponse != null) { + + l = Float.parseFloat(firstResponse.substring(0, firstResponse.indexOf(','))); + b = Float.parseFloat(firstResponse.substring(firstResponse.indexOf(',') + 1, firstResponse.length() - 1)); + + h = Float.parseFloat(secondResponse.substring(0, secondResponse.indexOf(','))); + tmp = Float.parseFloat(secondResponse.substring(secondResponse.indexOf(',') + 1, secondResponse.length() - 1)); + + dim.add(l); + dim.add(b); + dim.add(h); + dim.add(tmp); + Float min = Float.MAX_VALUE; + for (int i = 0; i < dim.size(); i++) { + for (int j = i + 1; j < dim.size(); j++) { + if (Math.abs(dim.get(i) - dim.get(j)) < min) + min = Math.abs(dim.get(i) - dim.get(j)); + } + } + + for (int i = 0; i < dim.size(); i++) { + for (int j = i + 1; j < dim.size(); j++) { + if (min.equals(Math.abs(dim.get(i) - dim.get(j)))) + dim.remove(j); + } + } + + firstResponse = secondResponse = null; + } + return dim; + } + +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/paymentconform.java b/app/src/main/java/com/pb/nex26dv/shippingapp/paymentconform.java new file mode 100755 index 0000000..37a266b --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/paymentconform.java @@ -0,0 +1,13 @@ +package com.pb.nex26dv.shippingapp; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; + +public class paymentconform extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_paymentconform); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/paymentpage.java b/app/src/main/java/com/pb/nex26dv/shippingapp/paymentpage.java new file mode 100755 index 0000000..41be59e --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/paymentpage.java @@ -0,0 +1,13 @@ +package com.pb.nex26dv.shippingapp; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; + +public class paymentpage extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_paymentpage); + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/registration.java b/app/src/main/java/com/pb/nex26dv/shippingapp/registration.java new file mode 100755 index 0000000..ded9885 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/registration.java @@ -0,0 +1,69 @@ +package com.pb.nex26dv.shippingapp; + +import android.content.Context; +import android.content.Intent; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.View; +import android.widget.EditText; +import android.widget.Toast; + +public class registration extends AppCompatActivity { + + DBHelper helper = new DBHelper(this); + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_registration); + } + + public void onSignupClick(View view) { + if (view.getId() == R.id.signupbutton) { + EditText name = (EditText) findViewById(R.id.editTextName); + EditText email = (EditText) findViewById(R.id.editTextEmail); + EditText mobile = (EditText) findViewById(R.id.editTextMobile); + EditText pass1 = (EditText) findViewById(R.id.editTextPass1); + EditText pass2 = (EditText) findViewById(R.id.editTextPass2); + + String nameStr = name.getText().toString(); + String emailStr = email.getText().toString(); + String mobileStr = mobile.getText().toString(); + String pass1Str = pass1.getText().toString(); + String pass2Str = pass2.getText().toString(); + + + if (nameStr.trim().isEmpty()) { + name.setError("Name is required!"); + } else if (emailStr.trim().equals("")) { + email.setError("Email is required!"); + } else if (mobileStr.trim().equals("")) { + mobile.setError("Name is required!"); + } else if (pass1Str.trim().equals("")) { + pass1.setError("Name is required!"); + } else if (pass2Str.trim().equals("")) { + pass2.setError("Name is required!"); + } else { + if (!pass1Str.equals(pass2Str)) { + Toast pass = Toast.makeText(this, "Passwords don't match!", Toast.LENGTH_SHORT); + pass.show(); + } else if (!Utility.validate(emailStr)) { + Toast mail = Toast.makeText(this, "Email Format is Wrong", Toast.LENGTH_SHORT); + mail.show(); + } else { + Contact contact = new Contact(); + contact.setName(nameStr); + contact.setEmail(emailStr); + contact.setPass(pass1Str); + contact.setMobile(mobileStr); + + helper.insertContact(contact); + + Intent loginIntent = new Intent(registration.this, loginActivity.class); + loginIntent.putExtra("email", emailStr); + startActivity(loginIntent); + } + } + } + } +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/shipping_order_page.java b/app/src/main/java/com/pb/nex26dv/shippingapp/shipping_order_page.java new file mode 100755 index 0000000..1a797c8 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/shipping_order_page.java @@ -0,0 +1,31 @@ +package com.pb.nex26dv.shippingapp; + + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + + +/** + * A simple {@link Fragment} subclass. + */ +public class shipping_order_page extends Fragment { + + + public shipping_order_page() { + // Required empty public constructor + } + + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_shipping_order_page, container, false); + } + + + +} diff --git a/app/src/main/java/com/pb/nex26dv/shippingapp/wishlist.java b/app/src/main/java/com/pb/nex26dv/shippingapp/wishlist.java new file mode 100755 index 0000000..77c4ba2 --- /dev/null +++ b/app/src/main/java/com/pb/nex26dv/shippingapp/wishlist.java @@ -0,0 +1,13 @@ +package com.pb.nex26dv.shippingapp; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; + +public class wishlist extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_wishlist); + } +} diff --git a/app/src/main/res/anim/alpha.xml b/app/src/main/res/anim/alpha.xml new file mode 100755 index 0000000..62f84a6 --- /dev/null +++ b/app/src/main/res/anim/alpha.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/app/src/main/res/anim/translate.xml b/app/src/main/res/anim/translate.xml new file mode 100755 index 0000000..53b20fe --- /dev/null +++ b/app/src/main/res/anim/translate.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/background.jpg b/app/src/main/res/drawable-v21/background.jpg new file mode 100755 index 0000000..6a52458 Binary files /dev/null and b/app/src/main/res/drawable-v21/background.jpg differ diff --git a/app/src/main/res/drawable-v21/backgroundmap4.jpg b/app/src/main/res/drawable-v21/backgroundmap4.jpg new file mode 100755 index 0000000..7e3390f Binary files /dev/null and b/app/src/main/res/drawable-v21/backgroundmap4.jpg differ diff --git a/app/src/main/res/drawable-v21/box.png b/app/src/main/res/drawable-v21/box.png new file mode 100755 index 0000000..2fb66d4 Binary files /dev/null and b/app/src/main/res/drawable-v21/box.png differ diff --git a/app/src/main/res/drawable-v21/clipboard.png b/app/src/main/res/drawable-v21/clipboard.png new file mode 100755 index 0000000..4c772e5 Binary files /dev/null and b/app/src/main/res/drawable-v21/clipboard.png differ diff --git a/app/src/main/res/drawable-v21/cus_pic.png b/app/src/main/res/drawable-v21/cus_pic.png new file mode 100755 index 0000000..e0925db Binary files /dev/null and b/app/src/main/res/drawable-v21/cus_pic.png differ diff --git a/app/src/main/res/drawable-v21/fastvan.png b/app/src/main/res/drawable-v21/fastvan.png new file mode 100755 index 0000000..7224868 Binary files /dev/null and b/app/src/main/res/drawable-v21/fastvan.png differ diff --git a/app/src/main/res/drawable-v21/ic_menu_camera.xml b/app/src/main/res/drawable-v21/ic_menu_camera.xml new file mode 100755 index 0000000..0d9ea10 --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_camera.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable-v21/ic_menu_gallery.xml b/app/src/main/res/drawable-v21/ic_menu_gallery.xml new file mode 100755 index 0000000..f6872c4 --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_gallery.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable-v21/ic_menu_manage.xml b/app/src/main/res/drawable-v21/ic_menu_manage.xml new file mode 100755 index 0000000..c1be60b --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_manage.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_menu_send.xml b/app/src/main/res/drawable-v21/ic_menu_send.xml new file mode 100755 index 0000000..00c668c --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_send.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable-v21/ic_menu_share.xml b/app/src/main/res/drawable-v21/ic_menu_share.xml new file mode 100755 index 0000000..a28fb9e --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_share.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable-v21/ic_menu_slideshow.xml b/app/src/main/res/drawable-v21/ic_menu_slideshow.xml new file mode 100755 index 0000000..209aa64 --- /dev/null +++ b/app/src/main/res/drawable-v21/ic_menu_slideshow.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable-v21/openbox.png b/app/src/main/res/drawable-v21/openbox.png new file mode 100755 index 0000000..96227c7 Binary files /dev/null and b/app/src/main/res/drawable-v21/openbox.png differ diff --git a/app/src/main/res/drawable-v21/pb_banner.png b/app/src/main/res/drawable-v21/pb_banner.png new file mode 100755 index 0000000..51a17db Binary files /dev/null and b/app/src/main/res/drawable-v21/pb_banner.png differ diff --git a/app/src/main/res/drawable-v21/pitneybowes_logo.png b/app/src/main/res/drawable-v21/pitneybowes_logo.png new file mode 100755 index 0000000..d2b84b2 Binary files /dev/null and b/app/src/main/res/drawable-v21/pitneybowes_logo.png differ diff --git a/app/src/main/res/drawable-v21/ship.png b/app/src/main/res/drawable-v21/ship.png new file mode 100755 index 0000000..a8f9735 Binary files /dev/null and b/app/src/main/res/drawable-v21/ship.png differ diff --git a/app/src/main/res/drawable-v21/troly.png b/app/src/main/res/drawable-v21/troly.png new file mode 100755 index 0000000..66c0c95 Binary files /dev/null and b/app/src/main/res/drawable-v21/troly.png differ diff --git a/app/src/main/res/drawable-v21/vanearth.png b/app/src/main/res/drawable-v21/vanearth.png new file mode 100755 index 0000000..a14e3b1 Binary files /dev/null and b/app/src/main/res/drawable-v21/vanearth.png differ diff --git a/app/src/main/res/drawable/background.jpg b/app/src/main/res/drawable/background.jpg new file mode 100755 index 0000000..6a52458 Binary files /dev/null and b/app/src/main/res/drawable/background.jpg differ diff --git a/app/src/main/res/drawable/backgroundmap4.jpg b/app/src/main/res/drawable/backgroundmap4.jpg new file mode 100755 index 0000000..7e3390f Binary files /dev/null and b/app/src/main/res/drawable/backgroundmap4.jpg differ diff --git a/app/src/main/res/drawable/box.png b/app/src/main/res/drawable/box.png new file mode 100755 index 0000000..2fb66d4 Binary files /dev/null and b/app/src/main/res/drawable/box.png differ diff --git a/app/src/main/res/drawable/clipboard.png b/app/src/main/res/drawable/clipboard.png new file mode 100755 index 0000000..4c772e5 Binary files /dev/null and b/app/src/main/res/drawable/clipboard.png differ diff --git a/app/src/main/res/drawable/cus_pic.png b/app/src/main/res/drawable/cus_pic.png new file mode 100755 index 0000000..e0925db Binary files /dev/null and b/app/src/main/res/drawable/cus_pic.png differ diff --git a/app/src/main/res/drawable/fastvan.png b/app/src/main/res/drawable/fastvan.png new file mode 100755 index 0000000..7224868 Binary files /dev/null and b/app/src/main/res/drawable/fastvan.png differ diff --git a/app/src/main/res/drawable/openbox.png b/app/src/main/res/drawable/openbox.png new file mode 100755 index 0000000..96227c7 Binary files /dev/null and b/app/src/main/res/drawable/openbox.png differ diff --git a/app/src/main/res/drawable/pb_banner.png b/app/src/main/res/drawable/pb_banner.png new file mode 100755 index 0000000..51a17db Binary files /dev/null and b/app/src/main/res/drawable/pb_banner.png differ diff --git a/app/src/main/res/drawable/pitneybowes_logo.png b/app/src/main/res/drawable/pitneybowes_logo.png new file mode 100755 index 0000000..d2b84b2 Binary files /dev/null and b/app/src/main/res/drawable/pitneybowes_logo.png differ diff --git a/app/src/main/res/drawable/ship.png b/app/src/main/res/drawable/ship.png new file mode 100755 index 0000000..a8f9735 Binary files /dev/null and b/app/src/main/res/drawable/ship.png differ diff --git a/app/src/main/res/drawable/side_nav_bar.xml b/app/src/main/res/drawable/side_nav_bar.xml new file mode 100755 index 0000000..458b4b0 --- /dev/null +++ b/app/src/main/res/drawable/side_nav_bar.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/troly.png b/app/src/main/res/drawable/troly.png new file mode 100755 index 0000000..66c0c95 Binary files /dev/null and b/app/src/main/res/drawable/troly.png differ diff --git a/app/src/main/res/drawable/vanearth.png b/app/src/main/res/drawable/vanearth.png new file mode 100755 index 0000000..a14e3b1 Binary files /dev/null and b/app/src/main/res/drawable/vanearth.png differ diff --git a/app/src/main/res/layout-v21/fragment_main_display_page.xml b/app/src/main/res/layout-v21/fragment_main_display_page.xml new file mode 100755 index 0000000..9279098 --- /dev/null +++ b/app/src/main/res/layout-v21/fragment_main_display_page.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_conformationpage.xml b/app/src/main/res/layout/activity_conformationpage.xml new file mode 100755 index 0000000..92933e4 --- /dev/null +++ b/app/src/main/res/layout/activity_conformationpage.xml @@ -0,0 +1,43 @@ + + + +