stable veriosn of EZDine

parents
Showing with 4852 additions and 0 deletions
*.iml
.gradle
/local.properties
/build
/.idea
/.sonar
.sonar/
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/EZDineApp.iml" filepath="$PROJECT_DIR$/EZDineApp.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
The file could not be displayed because it is too large.
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0.0_INT","enabled":true,"outputFile":"EZDineApp-INT-debug.apk","fullName":"INTDebug","baseName":"INT-debug"},"path":"EZDineApp-INT-debug.apk","properties":{}}]
\ No newline at end of file
<!--
~ Copyright © 2016 by Vsoft Consulting Corporation.
~
~ All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
~ any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
~ written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
~ other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
~ “Attention: Permissions Coordinator,” at the address below.
~
~ PTech Solutions Pvt. Ltd.
~ www.vsoftconsulting.com/
~
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output indent="yes" method="html"/>
<xsl:decimal-format decimal-separator="." grouping-separator=","/>
<xsl:key name="files" match="file" use="@name"/>
<!-- Checkstyle XML Style Sheet by Stephane Bailliez <sbailliez@apache.org> -->
<!-- Part of the Checkstyle distribution found at http://checkstyle.sourceforge.net -->
<!-- Usage (generates checkstyle_report.html): -->
<!-- <checkstyle failonviolation="false" config="${check.config}"> -->
<!-- <fileset dir="${src.dir}" includes="**/*.java"/> -->
<!-- <formatter type="xml" toFile="${doc.dir}/checkstyle_report.xml"/> -->
<!-- </checkstyle> -->
<!-- <style basedir="${doc.dir}" destdir="${doc.dir}" -->
<!-- includes="checkstyle_report.xml" -->
<!-- style="${doc.dir}/checkstyle-noframes-sorted.xsl"/> -->
<xsl:template match="checkstyle">
<html>
<head>
<style type="text/css">
.bannercell {
border: 0px;
padding: 0px;
}
body {
margin-left: 10;
margin-right: 10;
font:normal 80% arial,helvetica,sanserif;
background-color:#FFFFFF;
color:#000000;
}
.a td {
background: #efefef;
}
.b td {
background: #fff;
}
th, td {
text-align: left;
vertical-align: top;
}
th {
font-weight:bold;
background: #ccc;
color: black;
}
table, th, td {
font-size:100%;
border: none
}
table.log tr td, tr th {
}
h2 {
font-weight:bold;
font-size:140%;
margin-bottom: 5;
}
h3 {
font-size:100%;
font-weight:bold;
background: #525D76;
color: white;
text-decoration: none;
padding: 5px;
margin-right: 2px;
margin-left: 2px;
margin-bottom: 0;
}
</style>
</head>
<body>
<a name="top"></a>
<!-- jakarta logo -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="bannercell" rowspan="2">
<!--a href="http://jakarta.apache.org/">
<img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
</a-->
</td>
<td class="text-align:right">
<h2>CheckStyle Audit</h2>
</td>
</tr>
<tr>
<td class="text-align:right">Designed for use with
<a href='http://checkstyle.sourceforge.net/'>CheckStyle</a>
and<a href='http://jakarta.apache.org'>Ant</a>.
</td>
</tr>
</table>
<hr size="1"/>
<!-- Summary part -->
<xsl:apply-templates mode="summary" select="."/>
<hr align="left" size="1" width="100%"/>
<!-- Package List part -->
<xsl:apply-templates mode="filelist" select="."/>
<hr align="left" size="1" width="100%"/>
<!-- For each package create its part -->
<xsl:apply-templates select="file[@name and generate-id(.) = generate-id(key('files', @name))]"/>
<hr align="left" size="1" width="100%"/>
</body>
</html>
</xsl:template>
<xsl:template match="checkstyle" mode="filelist">
<h3>Files</h3>
<table border="0" cellpadding="5" cellspacing="2" class="log" width="100%">
<tr>
<th>Name</th>
<th>Errors</th>
</tr>
<xsl:for-each select="file[@name and generate-id(.) = generate-id(key('files', @name))]">
<xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error)"/>
<xsl:variable name="errorCount" select="count(error)"/>
<tr>
<xsl:call-template name="alternated-row"/>
<td>
<a href="#f-{@name}">
<xsl:value-of select="@name"/>
</a>
</td>
<td>
<xsl:value-of select="$errorCount"/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template match="file">
<a name="f-{@name}"></a>
<h3>File
<xsl:value-of select="@name"/>
</h3>
<table border="0" cellpadding="5" cellspacing="2" class="log" width="100%">
<tr>
<th>Error Description</th>
<th>Line</th>
</tr>
<xsl:for-each select="key('files', @name)/error">
<xsl:sort data-type="number" order="ascending" select="@line"/>
<tr>
<xsl:call-template name="alternated-row"/>
<td>
<xsl:value-of select="@message"/>
</td>
<td>
<xsl:value-of select="@line"/>
</td>
</tr>
</xsl:for-each>
</table>
<a href="#top">Back to top</a>
</xsl:template>
<xsl:template match="checkstyle" mode="summary">
<h3>Summary</h3>
<xsl:variable name="fileCount"
select="count(file[@name and generate-id(.) = generate-id(key('files', @name))])"/>
<xsl:variable name="errorCount" select="count(file/error)"/>
<table border="0" cellpadding="5" cellspacing="2" class="log" width="100%">
<tr>
<th>Files</th>
<th>Errors</th>
</tr>
<tr>
<xsl:call-template name="alternated-row"/>
<td>
<xsl:value-of select="$fileCount"/>
</td>
<td>
<xsl:value-of select="$errorCount"/>
</td>
</tr>
</table>
</xsl:template>
<xsl:template name="alternated-row">
<xsl:attribute name="class">
<xsl:if test="position() mod 2 = 1">a</xsl:if>
<xsl:if test="position() mod 2 = 0">b</xsl:if>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0"?>
<!--
~ Copyright © 2016 by Vsoft Consulting Corporation.
~
~ All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
~ any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
~ written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
~ other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
~ “Attention: Permissions Coordinator,” at the address below.
~
~ PTech Solutions Pvt. Ltd.
~ www.vsoftconsulting.com/
~
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<!-- Checks that a package-info.java file exists for each package. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
<!--
<module name="JavadocPackage">
<property name="allowLegacy" value="true"/>
</module>
-->
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>
<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation"/>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="FileLength"/>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<!--<module name="FileTabCharacter"/>-->
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="minimum" value="0"/>
<property name="maximum" value="0"/>
<property name="message" value="Line has trailing spaces."/>
<property name="severity" value="info"/>
</module>
<module name="TreeWalker">
<module name="RegexpSinglelineJava">
<property name="format" value="^\t* +\t*\S"/>
<property name="message"
value="Line has leading space characters; indentation should be performed with tabs only."/>
<property name="ignoreComments" value="true"/>
</module>
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocMethod">
<property name="scope" value="package"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="allowUndeclaredRTE" value="true"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
</module>
<module name="JavadocType">
<property name="scope" value="package"/>
</module>
<module name="JavadocVariable">
<property name="scope" value="package"/>
</module>
<module name="JavadocStyle">
<property name="checkEmptyJavadoc" value="true"/>
</module>
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<!-- what is a good max value? -->
<property name="max" value="120"/>
<!-- ignore lines like "$File: //depot/... $" -->
<property name="ignorePattern" value="\$File.*\$"/>
<property name="severity" value="info"/>
</module>
<module name="MethodLength"/>
<module name="ParameterNumber"/>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/>
<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock">
<property name="option" value="text"/>
</module>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!-- <module name="AvoidInlineConditionals"/> -->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true"/>
<property name="ignoreSetter" value="true"/>
<property name="severity" value="warning"/>
</module>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<!--<module name="MagicNumber">-->
<!--<property name="severity" value="warning"/>-->
<!--</module>-->
<module name="MissingSwitchDefault"/>
<!-- Problem with finding exception types... -->
<module name="RedundantThrows">
<property name="allowUnchecked" value="true"/>
<property name="suppressLoadErrors" value="true"/>
<property name="severity" value="info"/>
</module>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!-- <module name="DesignForExtension"/> -->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier"/>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<!-- <module name="FinalParameters"/> -->
<module name="TodoComment">
<property name="format" value="TODO"/>
<property name="severity" value="info"/>
</module>
<module name="UpperEll"/>
<module name="FileContentsHolder"/> <!-- Required by comment suppression filters -->
</module>
<!-- Enable suppression comments -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE IGNORE\s+(\S+)"/>
<property name="onCommentFormat" value="CHECKSTYLE END IGNORE\s+(\S+)"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="SuppressWithNearbyCommentFilter">
<!-- Syntax is "SUPPRESS CHECKSTYLE name" -->
<property name="commentFormat" value="SUPPRESS CHECKSTYLE (\w+)"/>
<property name="checkFormat" value="$1"/>
<property name="influenceFormat" value="1"/>
</module>
</module>
\ No newline at end of file
{
"project_info": {
"project_number": "485803692704",
"firebase_url": "https://ezdine-4453c.firebaseio.com",
"project_id": "ezdine-4453c",
"storage_bucket": "ezdine-4453c.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:485803692704:android:09a573fc928c46e9",
"android_client_info": {
"package_name": "com.vsoft.ezdine.android"
}
},
"oauth_client": [
{
"client_id": "485803692704-et6kle8ocn3djn12jj5ntk69vohsbq5m.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.vsoft.ezdine.android",
"certificate_hash": "601C44B26D42FFA08C9C1198D83187B84B1124F2"
}
},
{
"client_id": "485803692704-8164a99i3ndc5j1rftoimuu2j00b11op.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAko19-NxT95rB4j_9AtWuh0icc7EOtmGM"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "485803692704-8164a99i3ndc5j1rftoimuu2j00b11op.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
No preview for this file type
#Mon May 20 15:22:53 IST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# 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
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# 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
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
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" -a "$nonstop" = "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
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@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
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@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=
@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 Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_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=%*
: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
No preview for this file type
No preview for this file type
No preview for this file type
## 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.
#Mon May 20 15:22:48 IST 2019
ndk.dir=C\:\\Users\\svennu\\AppData\\Local\\Android\\Sdk\\ndk-bundle
sdk.dir=C\:\\Users\\svennu\\AppData\\Local\\Android\\Sdk
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\npadhy\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 *;
#}
-keepattributes *Annotation*
-keepattributes Signature
-keep class sun.misc.Unsafe { *; }
-keep class com.vsoft.ezdine.android.model.** { *; }
-keep class * extends java.util.ListResourceBundle {
protected Object[][] getContents();
}
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final *** NULL;
}
-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
-keepattributes SourceFile, LineNumberTable
-dontskipnonpubliclibraryclassmembers
-keep class com.parse.** { *; }
-dontwarn com.parse.**
-keep class com.squareup.** { *; }
-dontwarn com.squareup.**
-keep class it.moondroid.coverflow.components.** { *; }
-dontwarn it.moondroid.coverflow.components.**
\ No newline at end of file
KEYSTORE_FILE=KeyStore/ezdine_keystore.jks
KEYSTORE_PASSWORD=Vsoft@123
KEY_ALIAS=EZDineAndroid
KEY_PASSWORD=Vsoft@123
\ No newline at end of file
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package android.ezdine.vsoft.com.ezdine;
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.assertEquals;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
/**
* Sample Test method.
*
* @throws Exception
*/
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("android.ezdine.vsoft.com.ezdine", appContext.getPackageName());
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* Vsoft Consulting Corporation
* www.vsoftconsulting.com
*
*/
package com.vsoft.ezdine.android.Interface;
/**
* Created by njulakanti on 11/18/2016.
*/
public interface OnLoadMoreListener {
void onLoadMore();
}
/*
* opyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* Vsoft Consulting Corporation
* www.vsoftconsulting.com
*/
package com.vsoft.ezdine.android.Interface;
/**
* Created by kvemulavada on 20-12-2016.
*/
public interface RefreshRecyclerView {
void refreshView();
}
package com.vsoft.ezdine.android.acra;
/**
* Created by npadhy on 12/29/2016.
*/
/**
* Created by prasani on 3/3/2016.
*/
import android.util.Log;
import com.vsoft.ezdine.android.app.EZDineApp;
import org.acra.ReportField;
import org.acra.collector.CrashReportData;
import org.acra.sender.ReportSender;
import org.acra.sender.ReportSenderException;
/**
* ACRAReportSender to Send mail on crash.
*/
public class ACRAReportSender implements ReportSender {
private String emailUsername;
private String emailPassword;
/**
* Constructor.
* @param emailUsername username for mail authentication.
* @param emailPassword password for mail authentication.
*/
public ACRAReportSender(String emailUsername, String emailPassword) {
super();
this.emailUsername = emailUsername;
this.emailPassword = emailPassword;
}
@Override
public void send(CrashReportData report)
throws ReportSenderException {
// Extract the required data out of the crash report.
String reportBody = createCrashReport(report);
// instantiate the email sender
GMailSender gMailSender = new GMailSender(emailUsername, emailPassword);
try {
// specify your recipients and send the email
gMailSender.sendMail(EZDineApp.getProperties().getProperty("SUBJECT")
.toString(),
reportBody, emailUsername,
EZDineApp.getProperties().getProperty("RECEPENTS").toString());
} catch (Exception e) {
Log.d("Error Sending email", e.toString());
}
}
/**
* Extract the required data out of the crash report.
*/
private String createCrashReport(CrashReportData report) {
// I've extracted only basic information.
// U can add loads more data using the enum ReportField. See below.
StringBuilder body = new StringBuilder();
body
.append("Device : " + report.getProperty(ReportField.BRAND) + "-" + report
.getProperty(ReportField.PHONE_MODEL))
.append("\n")
.append("Android Version :" + report.getProperty(ReportField.ANDROID_VERSION))
.append("\n")
.append("App Version : " + report.getProperty(ReportField.APP_VERSION_CODE))
.append("\n")
.append("STACK TRACE : \n" + report.getProperty(ReportField.STACK_TRACE));
return body.toString();
}
}
\ No newline at end of file
package com.vsoft.ezdine.android.acra;
/**
* Created by npadhy on 12/29/2016.
*/
import android.util.Log;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.Security;
import java.util.Properties;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.mail.Message;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
/**
* GmailSender class to send ACRA bug report.
*/
public class GMailSender extends javax.mail.Authenticator {
private String mailhost = "smtp.gmail.com";
private String user;
private String password;
private Session session;
static {
Security.addProvider(new JSSEProvider());
}
/**
* Constructor.
*
* @param user username.
* @param password password.
*/
public GMailSender(String user, String password) {
this.user = user;
this.password = password;
Properties props = new Properties();
props.setProperty("mail.transport.protocol", "smtp");
props.setProperty("mail.host", mailhost);
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.fallback", "false");
props.setProperty("mail.smtp.quitwait", "false");
session = Session.getDefaultInstance(props, this);
}
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(user, password);
}
/**
* Sending Email.
*
* @param subject Subject.
* @param body mail body.
* @param sender send mailid.
* @param recipients comma separated recipient email ids.
* @throws Exception Exception.
*/
public synchronized void sendMail(String subject, String body, String sender, String
recipients) throws Exception {
try {
MimeMessage message = new MimeMessage(session);
DataHandler handler = new DataHandler(new ByteArrayDataSource(body.getBytes(),
"text/plain"));
message.setSender(new InternetAddress(sender));
message.setSubject(subject);
message.setDataHandler(handler);
if (recipients.indexOf(',') > 0) {
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients));
} else {
message.setRecipient(Message.RecipientType.TO, new InternetAddress(recipients));
}
Transport.send(message);
} catch (Exception e) {
Log.d("Error Sending Email", e.toString());
}
}
/**
* ByteArrayDataSource.
*/
public class ByteArrayDataSource implements DataSource {
private byte[] data;
private String type;
/**
* Constructor.
*
* @param data Data.
* @param type Type.
*/
public ByteArrayDataSource(byte[] data, String type) {
super();
this.data = data;
this.type = type;
}
/**
* Constructor.
*
* @param data Data.
*/
public ByteArrayDataSource(byte[] data) {
super();
this.data = data;
}
public void setType(String type) {
this.type = type;
}
/**
* GetContentType.
*
* @return ContentType.
*/
public String getContentType() {
if (type == null) {
return "application/octet-stream";
} else {
return type;
}
}
/**
* GetInputStream.
* @return InputStream
* @throws IOException
*/
public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(data);
}
public String getName() {
return "ByteArrayDataSource";
}
/**
* GetOutputStream.
* @return OutputStream.
* @throws IOException
*/
public OutputStream getOutputStream() throws IOException {
throw new IOException("Not Supported");
}
}
}
package com.vsoft.ezdine.android.acra;
/**
* Created by npadhy on 12/29/2016.
*/
import java.security.AccessController;
import java.security.Provider;
/**
* Anotation for Supressing Warning.
*/
@SuppressWarnings("serial")
/**
* JSSEProvider Class.
*/
public final class JSSEProvider extends Provider {
/**
* Default Constructor.
*/
public JSSEProvider() {
super("HarmonyJSSE", 1.0, "Harmony JSSE Provider");
AccessController.doPrivileged(new java.security.PrivilegedAction<Void>() {
public Void run() {
put("SSLContext.TLS",
"org.apache.harmony.xnet.provider.jsse.SSLContextImpl");
put("Alg.Alias.SSLContext.TLSv1", "TLS");
put("KeyManagerFactory.X509",
"org.apache.harmony.xnet.provider.jsse.KeyManagerFactoryImpl");
put("TrustManagerFactory.X509",
"org.apache.harmony.xnet.provider.jsse.TrustManagerFactoryImpl");
return null;
}
});
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*de
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.adapter.DeliveryBillingAdaptor;
import com.vsoft.ezdine.android.fragment.AddAddressDialogFragment;
import com.vsoft.ezdine.android.model.DeliveryBillingModel;
import com.vsoft.ezdine.android.util.DividerItemDecoration;
import java.util.ArrayList;
/**
* DeliveryBilling in which we have to select our home address or office 0or any other addresses for the delivery.
*/
public class DeliveryBillingActivity extends AppCompatActivity {
private RecyclerView recyclerView;
private Button submit;
private DeliveryBillingModel deliveryBillingModel;
private DeliveryBillingAdaptor deliveryBillingAdaptor;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_delivery_billings_address);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
init();
deliveryBillingAdaptor = new DeliveryBillingAdaptor(this, prepareBillingList());
recyclerView.setAdapter(deliveryBillingAdaptor);
prepareBillingList();
}
private void init() {
recyclerView = (RecyclerView) findViewById(R.id.dev_recyclerview);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
recyclerView.setItemAnimator(new DefaultItemAnimator());
submit = (Button) findViewById(R.id.dev_payment_button);
submit.setOnClickListener(new ClickListener());
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.delivery_add_address, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.add_icon:
FragmentManager fm = getSupportFragmentManager();
AddAddressDialogFragment dialogFragment = new AddAddressDialogFragment();
dialogFragment.show(fm, "Add/Update Addess Fragment");
return true;
default:
return super.onOptionsItemSelected(item);
}
}
/**
* prepareBillingList is method for populating the data.
*/
private ArrayList<DeliveryBillingModel> prepareBillingList() {
ArrayList<DeliveryBillingModel> addressDetailsList = new ArrayList<>();
DeliveryBillingModel model = new DeliveryBillingModel("Office", "Delivery Charges:$50",
"haribowli," + "chariminar,madhapur", getResources().getDrawable(R.drawable.office),
true, "hyderabad-58");
addressDetailsList.add(model);
model = new DeliveryBillingModel("Home", "Delivery Charges: Free", "haribowli,"
+ "chariminar,madhapur",
getResources().getDrawable(R.drawable.home), false, "hyderabad-65");
addressDetailsList.add(model);
return addressDetailsList;
}
private class ClickListener implements View.OnClickListener {
@Override
public void onClick(View view) {
if (view == submit) {
Intent intent = new Intent(DeliveryBillingActivity.this, PaymentMethodActivity.class);
startActivity(intent);
}
}
}
}
/*
* opyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* Vsoft Consulting Corporation
* www.vsoftconsulting.com
*/
package com.vsoft.ezdine.android.activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ExpandableListView;
import android.widget.ExpandableListView.OnChildClickListener;
import android.widget.ExpandableListView.OnGroupClickListener;
import android.widget.ExpandableListView.OnGroupCollapseListener;
import android.widget.ExpandableListView.OnGroupExpandListener;
import android.widget.Toast;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.adapter.FoodCategoryExpAdapter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class FoodCategoryItemsActivity extends Activity {
private FoodCategoryExpAdapter listAdapter;
private ExpandableListView expListView;
private ArrayList<String> listDataHeader;
private HashMap<String, List<String>> listDataChild;
private boolean isCheckValue;
private Button orderSubmit;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.food_category_item);
// get the listview
expListView = (ExpandableListView) findViewById(R.id.lvExp);
orderSubmit = (Button) findViewById(R.id.btn_ordercategory);
// preparing list data
prepareListData();
listAdapter = new FoodCategoryExpAdapter(this, listDataHeader, listDataChild, isCheckValue);
expListView.setAdapter(listAdapter);
expListView.expandGroup(0);
expListView.expandGroup(1);
expListView.expandGroup(2);
expListView.expandGroup(3);
// Listview Group click listener
expListView.setOnGroupClickListener(new OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
return false;
}
});
// Listview Group expanded listener
expListView.setOnGroupExpandListener(new OnGroupExpandListener() {
@Override
public void onGroupExpand(int groupPosition) {
Toast.makeText(getApplicationContext(),
listDataHeader.get(groupPosition) + " Expanded",
Toast.LENGTH_SHORT).show();
}
});
// Listview Group collasped listener
expListView.setOnGroupCollapseListener(new OnGroupCollapseListener() {
@Override
public void onGroupCollapse(int groupPosition) {
Toast.makeText(getApplicationContext(),
listDataHeader.get(groupPosition) + " Collapsed",
Toast.LENGTH_SHORT).show();
}
});
// Listview on child click listener
expListView.setOnChildClickListener(new OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
// TODO Auto-generated method stub
isCheckValue = true;
// Toast.makeText(getApplicationContext(), listDataHeader.get(groupPosition)+ " : "+ listDataChild.get
// (listDataHeader.get(groupPosition)).get(childPosition).toString(), Toast
// .LENGTH_SHORT)
// .show();
listAdapter = new FoodCategoryExpAdapter(FoodCategoryItemsActivity.this, listDataHeader,
listDataChild, isCheckValue);
// setting list adapter
expListView.setAdapter(listAdapter);
return false;
}
});
orderSubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(FoodCategoryItemsActivity.this, AddToCartActivity.class);
startActivity(intent);
}
});
}
/*
* Preparing the list data
*/
private void prepareListData() {
listDataHeader = new ArrayList<String>();
listDataChild = new HashMap<>();
// Adding child data
listDataHeader.add("Veg");
listDataHeader.add("Non Veg");
listDataHeader.add("Beer");
listDataHeader.add("Liquor");
// Adding child data
List<String> vegstarters = new ArrayList<String>();
vegstarters.add("Curries");
vegstarters.add("Rice");
vegstarters.add("Tandoor");
vegstarters.add("Soups");
vegstarters.add("Kebab");
vegstarters.add("Soft Drinks");
List<String> nonstarters = new ArrayList<String>();
nonstarters.add("Curries");
nonstarters.add("Rice");
nonstarters.add("Tandoor");
nonstarters.add("Soups");
nonstarters.add("Kebab");
nonstarters.add("Soft Drinks");
List<String> biryani = new ArrayList<String>();
biryani.add("Curries");
biryani.add("Rice");
biryani.add("Tandoor");
biryani.add("Soups");
biryani.add("Kebab");
biryani.add("Soft Drinks");
List<String> beverages = new ArrayList<String>();
beverages.add("Curries");
beverages.add("Rice");
beverages.add("Tandoor");
beverages.add("Soups");
beverages.add("Kebab");
beverages.add("Soft Drinks");
listDataChild.put(listDataHeader.get(0), vegstarters); // Header, Child data
listDataChild.put(listDataHeader.get(1), nonstarters);
listDataChild.put(listDataHeader.get(2), biryani);
listDataChild.put(listDataHeader.get(3), beverages);
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.network.EZDineServiceCall;
import com.vsoft.ezdine.android.util.AppLog;
import org.json.JSONObject;
import java.util.HashMap;
/**
* ForgotPassword is activity in which whenever user forgot the password comes enter his email id
* is sended to their mail.
*/
public class ForgotPasswordActivity extends AppCompatActivity {
private EditText etEmail;
private Button btnSubmit;
private String email;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forgot_password);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
init();
btnSubmit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (valid()) {
}
}
});
}
private void init() {
etEmail = (EditText) findViewById(R.id.forgot_editText_email);
btnSubmit = (Button) findViewById(R.id.forgot_button_submit);
}
private boolean valid() {
// if (TextUtils.isEmpty(etEmail.getText().toString())) {
// etEmail.requestFocus();
// etEmail.setError(getResources().getString(R.string.enter_email));
// return false;
// }
String email = etEmail.getText().toString().trim();
if (TextUtils.isEmpty(email)) {
etEmail.setError(getResources().getString(R.string.enter_email));
etEmail.requestFocus();
} else {
String emailPattern = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+";
if (email.matches(emailPattern)) {
Toast.makeText(getApplicationContext(), "valid email address", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(), "Invalid email address", Toast.LENGTH_SHORT).show();
}
}
makeServiceCall();
// onClick of button perform this simplest code.
return true;
}
private void makeServiceCall() {
EZDineServiceCall ezDineServiceCall = new EZDineServiceCall(this, "url") {
@Override
public void onSuccess(JSONObject object) {
if (object != null) {
AppLog.d("response", "success");
}
}
@Override
public void onError(String errorMsg) {
AppLog.d("response", "failed");
}
};
HashMap<String, String> params = new HashMap<>();
params.put("email", email);
ezDineServiceCall.addPostParams(params);
ezDineServiceCall.execute();
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.network.EZDineServiceCall;
import com.vsoft.ezdine.android.util.AppLog;
import com.vsoft.ezdine.android.util.Validation;
import org.json.JSONObject;
import java.util.HashMap;
/**
* Login class is used for authenication purpose.
*/
public class LoginActivity extends AppCompatActivity {
Validation validation = Validation.getInstance();
private Button loginButton;
private EditText edtEmail, edtPassword;
private TextInputLayout tilEmail, tilPwd;
private TextView login_forgotpwd;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
init();
loginButton.setOnClickListener(new ClickListener());
login_forgotpwd.setOnClickListener(new ClickListener());
}
private boolean valid() {
if (!validation.editTextIsEmpty(edtEmail, "Username should not be empty", tilEmail)) {
return false;
}
if (!validation.editTextIsEmpty(edtPassword, "Password should not be empty", tilPwd)) {
return false;
}
if (!validation.checkPasswordStrength(edtPassword.getText().toString(), "password must be 1 "
+ "capital letter,1 special character except under score,1 number", tilPwd)) {
return false;
}
/*if (!validation.isValidEmail(edtEmail.getText().toString(),"enter email address properly",tilEmail)
||!validation.isValidMobile(edtEmail.getText().toString(),"enter mobile number properly",tilEmail)) {
return false;
}*/
if (!validation.isValidEmailPhone(edtEmail.getText().toString(), tilEmail)) {
return false;
}
return true;
}
/**
* initialization of components.
*/
private void init() {
loginButton = (Button) findViewById(R.id.login_button);
edtEmail = (EditText) findViewById(R.id.edt_login_email);
edtPassword = (EditText) findViewById(R.id.edt_login_password);
tilEmail = (TextInputLayout) findViewById(R.id.textInputLayoutEmail);
tilPwd = (TextInputLayout) findViewById(R.id.textInputLayoutPwd);
login_forgotpwd = (TextView) findViewById(R.id.login_forgotpwd);
}
private void makeServiceCall() {
EZDineServiceCall serviceCall = new EZDineServiceCall(this, "http://search.twitter.com/search.json") {
@Override
public void onSuccess(JSONObject object) {
if (object != null) {
AppLog.d("response", "success");
Intent intent = new Intent(LoginActivity.this, DeliveryBillingActivity.class);
startActivity(intent);
}
}
@Override
public void onError(String errorMsg) {
AppLog.d("response", "failed");
}
};
HashMap<String, String> params = new HashMap<>();
params.put("q", "androidquery");
serviceCall.addPostParams(params);
serviceCall.execute();
}
private class ClickListener implements View.OnClickListener {
@Override
public void onClick(View view) {
if (view == loginButton) {
// if (valid()) {
Intent intent = new Intent(LoginActivity.this, DeliveryBillingActivity.class);
startActivity(intent);
// }
} else if (view == login_forgotpwd) {
Intent intent = new Intent(LoginActivity.this, ForgotPasswordActivity.class);
startActivity(intent);
}
}
}
}
\ No newline at end of file
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.fragment.MyOrdersFragment;
import com.vsoft.ezdine.android.util.FragmentUtil;
/**
* My orders is used to show the list of ordered products with status.
*/
public class MyOrdersActivity extends AppCompatActivity {
private static final String[] DATES = {"25-06-2016", "24-06-2016", "12-06-2016", "1-01-2016"};
private static final String[] DELIVARETO = {"Niladri P", "Niladri P", "Niladri P", "Niladri P"};
private static final String[] TOTALORDERS = {"2567.44", "948.97", "999.99", "6543.66"};
private static final String[] STATUS = {"Delivered", "Shipping", "Cancelled", "Pending"};
private static final String[] ORDERSID = {"324234-02394-2934", "322344-42344-3453", "534566-52411-5234", "763423-74247-6842"};
private RecyclerView ordersRecyclerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_orders);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
init();
populateMyordersRecycler();
FragmentUtil.addFragment(MyOrdersActivity.this, MyOrdersFragment.newInstance(), R.id.container,
false, false);
}
private void init() {
}
private void populateMyordersRecycler() {
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import com.vsoft.ezdine.android.R;
/**
* PayPalActivity Activity is payment gateway to do payment.
*/
public class PayPalActivity extends AppCompatActivity {
private Button submit;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pay_pal);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
init();
submit.setOnClickListener(new ClickListener());
}
private void init() {
submit = (Button) findViewById(R.id.dev_payment_button);
}
private class ClickListener implements View.OnClickListener {
@Override
public void onClick(View view) {
if (view == submit) {
Intent intent = new Intent(PayPalActivity.this, MyOrdersActivity.class);
startActivity(intent);
}
}
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.adapter.PaymentMethodAdapter;
import com.vsoft.ezdine.android.model.PaymentModel;
import com.vsoft.ezdine.android.util.DividerItemDecoration;
import java.util.ArrayList;
/**
* PaymentMethodActivity is used to select the payment options and select one of them.
*/
public class PaymentMethodActivity extends AppCompatActivity {
private RecyclerView paymentRecyclerView;
private Button selectPaymentMethod;
private PaymentMethodAdapter paymentMethodAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_payment_method);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
paymentRecyclerView = (RecyclerView) findViewById(R.id.pay_recyclerview);
paymentRecyclerView.setHasFixedSize(true);
paymentRecyclerView.setLayoutManager(new LinearLayoutManager(this));
paymentRecyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
paymentRecyclerView.setItemAnimator(new DefaultItemAnimator());
paymentMethodAdapter = new PaymentMethodAdapter(this, preparePaymentList());
paymentRecyclerView.setAdapter(paymentMethodAdapter);
preparePaymentList();
selectPaymentMethod = (Button) findViewById(R.id.pay_payment_button);
selectPaymentMethod.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(PaymentMethodActivity.this, PayPalActivity.class);
startActivity(intent);
}
});
}
private ArrayList<PaymentModel> preparePaymentList() {
ArrayList<PaymentModel> paymentList = new ArrayList<>();
PaymentModel model = new PaymentModel(getResources().getDrawable(R.drawable.creditcard),
"Credit Card", true);
paymentList.add(model);
PaymentModel model1 = new PaymentModel(getResources().getDrawable(R.drawable.netbanking),
"Internet Banking", false);
paymentList.add(model1);
PaymentModel model2 = new PaymentModel(getResources().getDrawable(R.drawable.debitcard),
"Debit Card", false);
paymentList.add(model2);
PaymentModel model3 = new PaymentModel(getResources().getDrawable(R.drawable.cashdelivey),
"Cash on Delivery", false);
paymentList.add(model3);
PaymentModel model4 = new PaymentModel(getResources().getDrawable(R.drawable.paypal),
"Paypal", false);
paymentList.add(model4);
return paymentList;
}
}
package com.vsoft.ezdine.android.activity;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.adapter.CustomPagerAdapterGrid;
import com.vsoft.ezdine.android.util.HackyViewPager;
import com.vsoft.ezdine.android.util.TouchImageView;
import java.util.ArrayList;
public class RecyclerGridGalleryActivity extends AppCompatActivity {
HackyViewPager resGalleryViewPager;
private CustomPagerAdapterGrid mCustomPagerAdapter;
private RadioGroup radioGroupGallery;
private ArrayList<String> pathList;
private boolean isResouces;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recycler_grid_gallery);
int position = getIntent().getExtras().getInt("position", 0);
pathList = getIntent().getStringArrayListExtra("IMAGE_PATH_LIST");
isResouces = getIntent().getBooleanExtra("IS_RESOURCE", true);
mCustomPagerAdapter = new CustomPagerAdapterGrid(this, isResouces, pathList);
resGalleryViewPager = (HackyViewPager) findViewById(R.id.viewPagerGridGallery);
radioGroupGallery = (RadioGroup) findViewById(R.id.radioGroupGallery);
for (int i = 0; i < pathList.size(); i++) {
RadioButton radioButton = new RadioButton(this);
radioButton.setId(i);
radioGroupGallery.addView(radioButton);
}
((RadioButton) radioGroupGallery.getChildAt(position)).setChecked(true);
resGalleryViewPager.setAdapter(mCustomPagerAdapter);
resGalleryViewPager.setCurrentItem(position);
resGalleryViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
radioGroupGallery.check((radioGroupGallery.getChildAt(position)).getId());
if (position > 0) {
View view = resGalleryViewPager.getChildAt(position - 1);
if (view != null) {
TouchImageView img = (TouchImageView) view.findViewById(R.id.resDetImageView);
}
}
if (position < resGalleryViewPager.getChildCount() - 1) {
View view = resGalleryViewPager.getChildAt(position + 1);
if (view != null) {
TouchImageView img = (TouchImageView) view.findViewById(R.id.resDetImageView);
}
}
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
radioGroupGallery.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
resGalleryViewPager.setCurrentItem(i, true);
}
});
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.vsoft.ezdine.android.R;
/**
* Registration Activity is used to enter the details for login.
*/
public class RegistrationActivity extends AppCompatActivity {
private EditText email, pwd, phno;
private Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registration);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
init();
button.setOnClickListener(new ClickListener());
}
/**
* The below method is used for initialization of components.
*/
private void init() {
email = (EditText) findViewById(R.id.reg_editText_email);
pwd = (EditText) findViewById(R.id.reg_editText_pwd);
phno = (EditText) findViewById(R.id.reg_editText_phno);
button = (Button) findViewById(R.id.reg_button);
}
private class ClickListener implements View.OnClickListener {
@Override
public void onClick(View view) {
if (view == button) {
Intent intent = new Intent(RegistrationActivity.this, DeliveryBillingActivity.class);
startActivity(intent);
}
}
}
}
package com.vsoft.ezdine.android.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.adapter.CustomPagerAdapter;
import java.util.ArrayList;
/**
* Created by pareti on 17-Nov-16.
*/
public class ResGalleryActivity extends AppCompatActivity {
private CustomPagerAdapter mCustomPagerAdapter;
private RecyclerView resGalleryRecyclerView;
private ArrayList<String> pathList;
private boolean isResouces;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_res_gallery_main);
pathList = getIntent().getStringArrayListExtra("IMAGE_PATH_LIST");
isResouces = getIntent().getBooleanExtra("IS_RESOURCE", true);
mCustomPagerAdapter = new CustomPagerAdapter(this, isResouces, pathList);
resGalleryRecyclerView = (RecyclerView) findViewById(R.id.resGalleryRecyclerView);
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
resGalleryRecyclerView.setLayoutManager(mLayoutManager);
resGalleryRecyclerView.setItemAnimator(new DefaultItemAnimator());
resGalleryRecyclerView.setAdapter(mCustomPagerAdapter);
}
}
/*
* opyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* Vsoft Consulting Corporation
* www.vsoftconsulting.com
*/
package com.vsoft.ezdine.android.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.vsoft.ezdine.android.Interface.RefreshRecyclerView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.adapter.ReservationHistoryAdapter;
import com.vsoft.ezdine.android.app.EZDineApp;
import com.vsoft.ezdine.android.db.EZDineDBHelper;
import com.vsoft.ezdine.android.model.ReservationHistoryModel;
import java.util.ArrayList;
public class ReservationHistoryActivity extends AppCompatActivity implements RefreshRecyclerView {
RecyclerView recyclerViewReservation;
EZDineDBHelper db;
ArrayList<ReservationHistoryModel> reservatonHistoryModels;
ReservationHistoryAdapter reservationHistoryAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reservation_history);
recyclerViewReservation = (RecyclerView) findViewById(R.id.recycler_view_reservation);
db = EZDineApp.getDbHelper();
dataFetchingIntoRecyclerView();
}
@Override
protected void onResume() {
super.onResume();
dataFetchingIntoRecyclerView();
}
public void dataFetchingIntoRecyclerView() {
// reservatonHistoryModels = (ArrayList<ReservationHistoryModel>) db.getReservationHistory();
// reservationHistoryAdapter = new ReservationHistoryAdapter(ReservationHistoryActivity.this,
// reservatonHistoryModels, this);
// RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
// recyclerViewReservation.setLayoutManager(mLayoutManager);
// recyclerViewReservation.setItemAnimator(new DefaultItemAnimator());
// recyclerViewReservation.setAdapter(reservationHistoryAdapter);
}
@Override
public void refreshView() {
dataFetchingIntoRecyclerView();
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
*
* Vsoft Consulting Corporation
* www.vsoftconsulting.com
*/
package com.vsoft.ezdine.android.activity;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ExpandableListView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.adapter.SelectCityExpAdapter;
import com.vsoft.ezdine.android.util.SharedPreferencesStore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class RestaurantBranchCitySelectionActivity extends Activity {
SelectCityExpAdapter listAdapter;
ExpandableListView expListView;
List<String> listDataHeader;
HashMap<String, List<String>> listDataChild;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_selected_area);
// get the listview
expListView = (ExpandableListView) findViewById(R.id.lvExpanddableListView);
expListView.post(new Runnable() {
@Override
public void run() {
expListView.expandGroup(0);
}
});
// preparing list data
prepareListData();
listAdapter = new SelectCityExpAdapter(this, listDataHeader, listDataChild);
// setting list adapter
expListView.setAdapter(listAdapter);
// Listview Group click listener
expListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
@Override
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
return false;
}
});
// Listview Group expanded listener
expListView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
@Override
public void onGroupExpand(int groupPosition) {
}
});
// Listview Group collasped listener
expListView.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
@Override
public void onGroupCollapse(int groupPosition) {
}
});
expListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
// TODO Auto-generated method stub
String selectedCity = listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition);
SharedPreferencesStore.setEncryptedSharedPref("Selected_CITY", selectedCity);
finish();
return true;
}
});
expListView.setItemChecked(2, true);
}
/*
* Preparing the list data
*/
private void prepareListData() {
listDataHeader = new ArrayList<String>();
listDataChild = new HashMap<String, List<String>>();
// Adding child data
listDataHeader.add("Top Cities");
listDataHeader.add("All Cities");
// Adding child data
List<String> topCitiesList = new ArrayList<String>();
topCitiesList.add("Hyderabad");
topCitiesList.add("Secundrabad");
topCitiesList.add("Vijayawada");
topCitiesList.add("Pune");
topCitiesList.add("Bangalore");
topCitiesList.add("Chennai");
List<String> allCitiesList = new ArrayList<String>();
allCitiesList.add("Hyderabad");
allCitiesList.add("Secundrabad");
allCitiesList.add("Vijayawada");
allCitiesList.add("Pune");
allCitiesList.add("Bangalore");
allCitiesList.add("Chennai");
allCitiesList.add("Meysore");
allCitiesList.add("Patna");
allCitiesList.add("Gowhati");
allCitiesList.add("Chandigarh");
allCitiesList.add("New Delhi");
allCitiesList.add("Agra");
listDataChild.put(listDataHeader.get(0), topCitiesList); // Header, Child data
listDataChild.put(listDataHeader.get(1), allCitiesList);
}
}
package com.vsoft.ezdine.android.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.fragment.OffersDealsFragment;
public class SelectCouponActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_coupon);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
OffersDealsFragment fragment = new OffersDealsFragment();
fragmentTransaction.add(R.id.fragmentSelectCoupon, fragment);
fragmentTransaction.commit();
}
public void updateCoupon(String coupon) {
Intent intent = new Intent();
intent.putExtra("coupon", coupon);
setResult(100, intent);
finish();
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.adapter.CartRecyclerviewItem;
import com.vsoft.ezdine.android.adapter.StarterAdapter;
import com.vsoft.ezdine.android.app.EZDineApp;
import com.vsoft.ezdine.android.db.EZDineDBHelper;
import com.vsoft.ezdine.android.model.OrderMenuModel;
import java.util.ArrayList;
/**
* Shopping Cart Activity is used to show the user selected products detail .
*/
public class ShoppingCart extends AppCompatActivity {
private RecyclerView mRecyclerView;
private LinearLayoutManager mLayoutManager;
private CartRecyclerviewItem mAdapter;
private Button buttonShoppingCartCheckout, btnSelectCoupon;
private TextView textViewShoppingCartTotalAmount, textViewShoppingCartNetAmount, textViewShoppingCartOrderTotal;
private EZDineDBHelper db;
private EditText editTextShoppingCartCouponCode;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_shopping_cart);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
init();
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerViewItems);
mRecyclerView.setHasFixedSize(true);
mLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setLayoutManager(mLayoutManager);
db = EZDineApp.getDbHelper();
mAdapter = new CartRecyclerviewItem();
mRecyclerView.setAdapter(mAdapter);
buttonShoppingCartCheckout = (Button) findViewById(R.id.buttonShoppingCartCheckout);
textViewShoppingCartTotalAmount = (TextView) findViewById(R.id.textViewShoppingCartTotalAmount);
textViewShoppingCartNetAmount = (TextView) findViewById(R.id.textViewShoppingCartNetAmount);
textViewShoppingCartOrderTotal = (TextView) findViewById(R.id.textViewShoppingCartOrderTotal);
textViewShoppingCartTotalAmount.setText("");
textViewShoppingCartNetAmount.setText("");
textViewShoppingCartOrderTotal.setText("");
buttonShoppingCartCheckout.setOnClickListener(new ClickListener());
changeTotalAmout();
}
private void init() {
btnSelectCoupon = (Button) findViewById(R.id.btnSelectCoupon);
editTextShoppingCartCouponCode = (EditText) findViewById(R.id.editTextShoppingCartCouponCode);
btnSelectCoupon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivityForResult(new Intent(ShoppingCart.this, SelectCouponActivity.class), 100);
}
});
}
@Override
protected void onResume() {
super.onResume();
//changeTotalAmout();
}
public void changeTotalAmout() {
float total = 0.0f;
float subToatalAmount;
ArrayList<OrderMenuModel> dataArrayList = new ArrayList<>(StarterAdapter.getSelectedMap().values());
for (OrderMenuModel model : dataArrayList) {
total += (Float.parseFloat(model.getProductPrice().replace("$", "").trim()) * model.getProductQuantity());
}
subToatalAmount = total - 0.0f;
float finalAmt = total + 5.0f + 5.0f;
textViewShoppingCartTotalAmount.setText("$ " + total + "");
textViewShoppingCartNetAmount.setText("$ " + subToatalAmount + "");
textViewShoppingCartOrderTotal.setText("$ " + finalAmt + "");
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 100) {
String coupon = "";
if (data != null)
coupon = data.getStringExtra("coupon");
editTextShoppingCartCouponCode.setText(coupon);
}
}
private class ClickListener implements View.OnClickListener {
@Override
public void onClick(View view) {
if (view == buttonShoppingCartCheckout) {
Intent intent = new Intent(ShoppingCart.this, SignUpActivity.class);
startActivity(intent);
}
}
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.facebook.CallbackManager;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import com.facebook.Profile;
import com.facebook.login.LoginResult;
import com.facebook.login.widget.LoginButton;
import com.google.android.gms.auth.api.Auth;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.auth.api.signin.GoogleSignInResult;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.SignInButton;
import com.google.android.gms.common.api.GoogleApiClient;
import com.squareup.picasso.Picasso;
import com.vsoft.ezdine.android.R;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Arrays;
/**
* SignUp class is providing user choice to login with facebook,email or ezDine login screen .
*/
public class SignUpActivity extends AppCompatActivity implements View.OnClickListener, GoogleApiClient.OnConnectionFailedListener {
private static final int RC_SIGN_IN = 9001;
//google plus
GoogleApiClient mGoogleApiClient;
GoogleSignInOptions gso;
private Button register, login;
private TextView info;
//fb login
private LoginButton faceBook;
private CallbackManager callBackManager;
private ImageView imageView;
private SignInButton signButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FacebookSdk.sdkInitialize(getApplicationContext());
callBackManager = CallbackManager.Factory.create();
setContentView(R.layout.activity_sign_up);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
init();
//google plus
signButton = (SignInButton) findViewById(R.id.sign_in_button);
gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).requestEmail().build();
mGoogleApiClient = new GoogleApiClient.Builder(this).enableAutoManage(this, this).addApi(Auth.GOOGLE_SIGN_IN_API, gso).build();
gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
signButton.setOnClickListener(this);
}
/**
* It is used for sigin in the google plus.
*/
private void signIn() {
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, RC_SIGN_IN);
}
/**
* It is used for initalize the values for the layout.
*/
private void init() {
register = (Button) findViewById(R.id.register);
imageView = (ImageView) findViewById(R.id.imageviewprofilepic);
login = (Button) findViewById(R.id.login);
register.setOnClickListener(new ClickListener());
login.setOnClickListener(new ClickListener());
//facebook
faceBook = (LoginButton) findViewById(R.id.login_button);
info = (TextView) findViewById(R.id.info);
faceBook.setReadPermissions("user_friends");
faceBook.setReadPermissions("public_profile");
faceBook.setReadPermissions(Arrays.asList("public_profile", "email"));
faceBook.setReadPermissions("email");
faceBook.setReadPermissions("user_birthday");
faceBook.setReadPermissions(Arrays.asList("public_profile", "email", "user_birthday", "user_friends"));
faceBook.registerCallback(callBackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(final LoginResult loginResult) {
GraphRequest request = GraphRequest.newMeRequest(loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject object, GraphResponse response) {
/*info.setText("User ID: " + loginResult.getAccessToken().getUserId() + "\n" +
"Auth Token: " + loginResult.getAccessToken().getToken());*/
try {
JSONObject data = response.getJSONObject();
Log.v("Name:", response.getJSONObject().get("name").toString());
String email = object.getString("email");
// String birthday = object.getString("birthday");
// String gender = object.getString("gender");
Profile profile = Profile.getCurrentProfile();
String firstName = profile.getFirstName();
String lastName = profile.getLastName();
if (data.has("picture")) {
String profilePicUrl = data.getJSONObject("picture").getJSONObject("data").getString("url");
Picasso.with(SignUpActivity.this).load(profilePicUrl).noFade().into(imageView);
}
info.setText("Name:" + response.getJSONObject().get("name").toString() + "\n" + "EmailId:" + email + "FirstName:" + firstName + "\n" + "LastName:" + lastName);
} catch (JSONException e) {
e.printStackTrace();
}
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,email,gender,birthday,picture.type(large)");
request.setParameters(parameters);
request.executeAsync();
}
@Override
public void onCancel() {
info.setText("Login attempt canceled.");
}
@Override
public void onError(FacebookException error) {
info.setText("Login attempt failed.");
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
handleSignInResult(result);
}
callBackManager.onActivityResult(requestCode, resultCode, data);
}
/**
* It is used for store the result from the google plus.
*/
private void handleSignInResult(GoogleSignInResult result) {
String personPhotoUrl = "";
if (result.isSuccess()) {
// Signed in successfully, show authenticated UI.
GoogleSignInAccount acct = result.getSignInAccount();
String email = acct.getEmail();
if (!personPhotoUrl.equals(null)) {
personPhotoUrl = acct.getPhotoUrl().toString();
} else {
imageView.setImageResource(R.drawable.profilepic);
}
info.setText("Name:" + acct.getDisplayName() + "\n" + "EmailID" + email);
Picasso.with(SignUpActivity.this).load(personPhotoUrl).noFade().into(imageView);
} else {
Toast.makeText(this, "Login Failed", Toast.LENGTH_LONG).show();
}
}
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
}
@Override
public void onClick(View view) {
if (view == signButton) {
signIn();
}
}
private class ClickListener implements View.OnClickListener {
@Override
public void onClick(View view) {
if (view == login) {
Intent intent = new Intent(SignUpActivity.this, LoginActivity.class);
startActivity(intent);
} else if (view == register) {
Intent intent = new Intent(SignUpActivity.this, RegistrationActivity.class);
startActivity(intent);
}
}
}
}
\ No newline at end of file
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.activity;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ContentResolver;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.KeyEvent;
import com.google.android.vending.licensing.AESObfuscator;
import com.google.android.vending.licensing.LicenseChecker;
import com.google.android.vending.licensing.LicenseCheckerCallback;
import com.google.android.vending.licensing.ServerManagedPolicy;
import com.google.firebase.iid.FirebaseInstanceId;
import com.vsoft.ezdine.android.BuildConfig;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.licencecheck.LicenceCheckUtil;
import com.vsoft.ezdine.android.network.NetworkUtil;
import com.vsoft.ezdine.android.util.AppLog;
import com.vsoft.ezdine.android.xmpputil.XMPPPubSubUtil;
import com.vsoft.ezdine.android.xmpputil.XMPPUtil;
import com.vsoft.ezdine.android.xmpputil.XmppConnectionAsyncTask;
import com.vsoft.ezdine.android.xmpputil.XmppConnectionCachingSingleton;
import org.jivesoftware.smack.AbstractXMPPConnection;
/**
* Splash Screen is the first screen of the application showing the restaurant logo.
*/
public class SplashActivity extends AppCompatActivity {
boolean licensed;
boolean checkingLicense;
boolean didCheck;
private Handler handler;
private LicenseChecker mChecker;
private LicenseCheckerCallback mLicenseCheckerCallback;
private Runnable r = new Runnable() {
@Override
public void run() {
startActivity(new Intent(SplashActivity.this, EZDineHomeActivity.class)
.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK));
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().hide();
setContentView(R.layout.activity_splash);
NetworkUtil.checkNetworkAvailable(this);
String token = FirebaseInstanceId.getInstance().getToken();
AppLog.d("Device Token",token+"");
if (!BuildConfig.DEBUG) {
mLicenseCheckerCallback = new MyLicenseCheckerCallback();
String deviceId = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
AppLog.i("Device Id", deviceId); //AN EXAMPLE OF LOGGING THAT YOU SHOULD BE DOING :)
mChecker = new LicenseChecker(this, new ServerManagedPolicy(this, new AESObfuscator(LicenceCheckUtil
.SALT, getPackageName
(), deviceId)), LicenceCheckUtil.BASE64_PUBLIC_KEY);
doCheck();
} else {
setupXMPPServer();
}
startPeriodicSync();
}
private void startHandler() {
// handler = new Handler();
// handler.post(r);
startActivity(new Intent(SplashActivity.this, EZDineHomeActivity.class)
.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK));
}
private void setupXMPPServer() {
XmppConnectionAsyncTask asyncTask = new XmppConnectionAsyncTask(this) {
@Override
public void onError(Exception e) {
AppLog.d("Error", e.getMessage());
startHandler();
}
@Override
public void onSuccess(AbstractXMPPConnection connection) {
startHandler();
if (connection != null) {
AppLog.d("Info", "Successfully Connected to XMPP Server");
XmppConnectionCachingSingleton logic = XmppConnectionCachingSingleton.getInstance();
logic.setConnection(connection);
XMPPPubSubUtil util = XMPPPubSubUtil.getInstance();
util.setup();
} else {
AppLog.d("Error", "Unable to connect to server, check your username & " +
"Password.");
}
}
};
asyncTask.execute(XMPPUtil.XMPP_ADMIN_USER_NAME, XMPPUtil.XMPP_ADMIN_PASSWORD);
}
@Override
public void onBackPressed() {
super.onBackPressed();
if (handler != null) {
handler.removeCallbacks(r);
}
finish();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (mChecker != null) {
mChecker.onDestroy();
}
}
private void doCheck() {
didCheck = false;
checkingLicense = true;
setProgressBarIndeterminateVisibility(true);
mChecker.checkAccess(mLicenseCheckerCallback);
}
protected Dialog onCreateDialog(int id) {
// We have only one dialog.
return new AlertDialog.Builder(this)
.setTitle("UNLICENSED APPLICATION DETECTED!")
.setMessage("This application is not licensed, please download it from the play store.")
.setPositiveButton("Download Now", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(
"http://market.android.com/details?id=" + getPackageName()));
startActivity(marketIntent);
finish();
}
})
.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
finish();
}
})
.setNeutralButton("Re-Check", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
doCheck();
}
})
.setCancelable(false)
.setOnKeyListener(new DialogInterface.OnKeyListener() {
public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
Log.i("License", "Key Listener");
finish();
return true;
}
})
.create();
}
private void startForceSync() {
String authority = getResources().getString(R.string.sync_adapter_authority);
Bundle bundle = new Bundle();
bundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
bundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
ContentResolver.requestSync(createDummyAccount(), authority, bundle);
ContentResolver.setIsSyncable(createDummyAccount(), authority, 1);
ContentResolver.setSyncAutomatically(createDummyAccount(), authority, true);
}
private void startPeriodicSync() {
String authority = getResources().getString(R.string.sync_adapter_authority);
Bundle bundle = new Bundle();
ContentResolver.addPeriodicSync(createDummyAccount(), authority, bundle, 30);
}
private Account createDummyAccount() {
Account dummyAccount = new Account(getResources().getString(R.string.app_name), "com.vsoft.ezdine.android"); // Acc , Acc
// Type
AccountManager accountManager = (AccountManager) getSystemService(ACCOUNT_SERVICE);
accountManager.addAccountExplicitly(dummyAccount, null, null);
return dummyAccount;
}
private class MyLicenseCheckerCallback implements LicenseCheckerCallback {
@Override
public void allow(int reason) {
// TODO Auto-generated method stub
if (isFinishing()) {
// Don't update UI if Activity is finishing.
return;
}
AppLog.i("License", "Accepted!");
//You can do other things here, like saving the licensed status to a
//SharedPreference so the app only has to check the license once.
licensed = true;
checkingLicense = false;
didCheck = true;
setupXMPPServer();
}
@SuppressWarnings("deprecation")
@Override
public void dontAllow(int reason) {
// TODO Auto-generated method stub
if (isFinishing()) {
// Don't update UI if Activity is finishing.
return;
}
AppLog.i("License", "Denied!");
AppLog.i("License", "Reason for denial: " + reason);
//You can do other things here, like saving the licensed status to a
//SharedPreference so the app only has to check the license once.
licensed = false;
checkingLicense = false;
didCheck = true;
showDialog(0);
}
@SuppressWarnings("deprecation")
@Override
public void applicationError(int reason) {
// TODO Auto-generated method stub
Log.i("License", "Error: " + reason);
if (isFinishing()) {
// Don't update UI if Activity is finishing.
return;
}
licensed = true;
checkingLicense = false;
didCheck = false;
showDialog(0);
}
}
}
/*
* opyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* Vsoft Consulting Corporation
* www.vsoftconsulting.com
*/
package com.vsoft.ezdine.android.activity;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.app.EZDineApp;
import com.vsoft.ezdine.android.db.EZDineDBHelper;
import com.vsoft.ezdine.android.fragment.AddAddressDialogFragment;
import com.vsoft.ezdine.android.fragment.SuccessAlertDialogFragment;
import com.vsoft.ezdine.android.model.ReservationHistoryModel;
import com.vsoft.ezdine.android.model.RestaurantBranchModel;
import com.vsoft.ezdine.android.util.SharedPreferencesStore;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
public class TableBookingActivity extends AppCompatActivity {
private Button book_restaurant_table;
private Intent intent;
private TextView personsQuantity, reservedCurrentDate, personTxt, branchTitleView;
private ImageView increaseQuantity, decreaseQuantity;
private String branchName, selectTimeDate, selectQunatity;
private Button chooseFirstTime, chooseSecondTime;
String userSelectedDateTime;
private EditText selectDateTimeBtn;
Calendar mDateAndTime = Calendar.getInstance();
EZDineDBHelper db;
private int mYear, mMonth, mDay, mHour, mMinute;
private ArrayList<RestaurantBranchModel> arrayList;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_table_booking);
db = EZDineApp.getDbHelper();
intent = getIntent();
branchName = intent.getStringExtra("selectRestaurantBranchName");
arrayList = (ArrayList<RestaurantBranchModel>) db.getRecords();
Bitmap image = BitmapFactory.decodeResource(getResources(), arrayList.get(0).getImage());
// img.setImageBitmap(image);
chooseFirstTime = (Button) findViewById(R.id.chooseFirstTime);
chooseSecondTime = (Button) findViewById(R.id.chooseSecondTime);
selectDateTimeBtn = (EditText) findViewById(R.id.selectDateTimeBtn);
book_restaurant_table = (Button) findViewById(R.id.book_restaurant_table);
personsQuantity = (TextView) findViewById(R.id.personsQuantity);
increaseQuantity = (ImageView) findViewById(R.id.increaseQuantity);
decreaseQuantity = (ImageView) findViewById(R.id.decreaseQuantity);
reservedCurrentDate = (TextView) findViewById(R.id.reservedCurrentDate);
branchTitleView = (TextView) findViewById(R.id.branchTitleView);
personTxt = (TextView) findViewById(R.id.personTxt);
// setCurrentDate();
selectTimeDate = selectDateTimeBtn.getText().toString();
selectQunatity = personsQuantity.getText().toString();
branchTitleView.setText(branchName);
userSelectedDateTime = SharedPreferencesStore.getEncryptedSharedPref("Selected_TIME_DATE");
if (userSelectedDateTime != null) {
chooseFirstTime.setBackground(getResources().getDrawable(R.drawable.select_date_rounded_corners));
chooseFirstTime.setText(userSelectedDateTime);
} else {
chooseFirstTime.setVisibility(View.GONE);
}
increaseQuantity.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int incrValue = Integer.parseInt(personsQuantity.getText().toString()) + 1;
personsQuantity.setText(incrValue + "");
}
});
decreaseQuantity.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (personsQuantity.getText().toString().equals("0")) {
personsQuantity.setText("0");
} else {
int decrValue = Integer.parseInt(personsQuantity.getText().toString()) - 1;
personsQuantity.setText(decrValue + "");
}
}
});
selectDateTimeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
// Process to get Current Date
setDate();
}
});
book_restaurant_table.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (selectDateTimeBtn.getText().toString().isEmpty()) {
selectDateTimeBtn.setError("this field can't leave empty");
} else if (personsQuantity.getText().toString().equals("0")) {
personTxt.setError("set persons Quantity");
} else if (selectDateTimeBtn.getText().toString().isEmpty() &&
personsQuantity.getText().toString().equals("0")) {
selectDateTimeBtn.setError("select the reservation time");
personTxt.setError("set persons Quantity");
} else {
showConformationDialog();
}
}
});
}
private void setDate() {
Calendar c = Calendar.getInstance();
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
DatePickerDialog dpd = new DatePickerDialog(TableBookingActivity.this,
new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year,
int monthOfYear, int dayOfMonth) {
// Display Selected date in textbox
String day, month;
if (dayOfMonth < 10) {
day = "0" + dayOfMonth;
} else {
day = "" + dayOfMonth;
}
if ((monthOfYear + 1) < 10) {
month = "0" + (monthOfYear + 1);
} else {
month = "" + (monthOfYear + 1);
}
selectDateTimeBtn.setText(year + "-" + month + "-" + day + "");
setTime();
}
}, mYear, mMonth, mDay);
dpd.show();
}
private void setTime() {
Calendar c = Calendar.getInstance();
mHour = c.get(Calendar.HOUR_OF_DAY);
mMinute = c.get(Calendar.MINUTE);
TimePickerDialog tpd = new TimePickerDialog(TableBookingActivity.this,
new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay,
int minute) {
// Display Selected time in textbox
String hour, min;
if (hourOfDay < 10) {
hour = "0" + hourOfDay;
} else {
hour = "" + hourOfDay;
}
if (minute < 10) {
min = "0" + minute;
} else {
min = "" + minute;
}
selectDateTimeBtn.append(" " + hour + ":" + min + "");
}
}, mHour, mMinute, false);
tpd.show();
}
private void showConformationDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(TableBookingActivity.this);
builder.setTitle("Conformation Alert");
String alert1 = "Branch Name : " + branchName;
String alert2 = "Time & Date : " + selectDateTimeBtn.getText().toString();
String alert3 = "Persons Quantity : " + personsQuantity.getText().toString();
builder.setMessage(alert1 + "\n" + "\n" + alert2 + "\n" + "\n" + alert3);
String positiveText = getString(android.R.string.ok);
builder.setPositiveButton(positiveText,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// positive button logic
reservationConformation();
}
});
String negativeText = getString(android.R.string.cancel);
builder.setNegativeButton(negativeText,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
AlertDialog dialog = builder.create();
// display dialog
dialog.show();
}
private void reservationConformation() {
String userSelectedTm = selectDateTimeBtn.getText().toString();
Calendar c = Calendar.getInstance();
SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy");
String formattedDate = df.format(c.getTime());
String timeDate = formattedDate + " " + userSelectedTm;
ReservationHistoryModel reservatonHistoryModel = new ReservationHistoryModel();
String bookingId = "324232-02394-2934";
reservatonHistoryModel.setBookinId(bookingId);
reservatonHistoryModel.setResStatus("Approved");
reservatonHistoryModel.setResDateTime(timeDate);
try {
long ii = db.addReservationDetails(reservatonHistoryModel);
Toast.makeText(TableBookingActivity.this, "insertCount" + ii + "", Toast.LENGTH_SHORT).show();
} catch (Exception e) {
e.printStackTrace();
}
// Toast.makeText(TableBookingActivity.this, "Table Reserved Successfully", Toast.LENGTH_SHORT)
// .show();
finish();
}
private void initiateReviewPopupWindow() {
FragmentManager fm = getSupportFragmentManager();
SuccessAlertDialogFragment dialogFragment = new SuccessAlertDialogFragment();
dialogFragment.show(fm, "success");
}
@Override
protected void onResume() {
super.onResume();
}
}
/*
* opyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* Vsoft Consulting Corporation
* www.vsoftconsulting.com
*/
package com.vsoft.ezdine.android.activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.app.EZDineApp;
import com.vsoft.ezdine.android.db.EZDineDBHelper;
import com.vsoft.ezdine.android.model.RestaurantBranchModel;
import java.util.ArrayList;
public class TableReservationAvailableTime extends AppCompatActivity {
EZDineDBHelper db;
private ArrayList<RestaurantBranchModel> arrayList;
ImageView img;
String selectBranchName;
private Button chooseFirstTime;
private TextView areaName;
String selectTimeDate;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_table_reservation_available_time);
showConformationDialog();
img=(ImageView)findViewById(R.id.imageView);
areaName=(TextView) findViewById(R.id.areaName);
chooseFirstTime=(Button) findViewById(R.id.chooseFirstTime);
db = EZDineApp.getDbHelper();
areaName.setText(selectBranchName);
chooseFirstTime.setText(selectTimeDate);
chooseFirstTime.setBackground(getResources().getDrawable(R.drawable.select_date_rounded_corners));
arrayList=(ArrayList<RestaurantBranchModel>)db.getRecords();
Bitmap image = BitmapFactory.decodeResource(getResources(), arrayList.get(0).getImage());
img.setImageBitmap(image);
// img.setImageBitmap(image);
}
private void showConformationDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(TableReservationAvailableTime.this);
Intent intent = getIntent();
selectBranchName=intent.getStringExtra("selectBranchName");
selectTimeDate=intent.getStringExtra("selectTimeDate");
String selectedPersonQuantity=intent.getStringExtra("selectedPersonQuantity");
builder.setTitle("Conformation Alert");
String alert1 = "Branch Name : " + selectBranchName;
String alert2 = "Time & Date : " + selectTimeDate;
String alert3 = "Person Quantity : " + selectedPersonQuantity;
builder.setMessage(alert1 +"\n"+ alert2 + "\n" + alert3);
String positiveText = getString(android.R.string.ok);
builder.setPositiveButton(positiveText,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// positive button logic
dialog.cancel();
}
});
String negativeText = getString(android.R.string.cancel);
builder.setNegativeButton(negativeText,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(TableReservationAvailableTime.this,TableBookingActivity.class);
startActivity(intent);
finish();
}
});
AlertDialog dialog = builder.create();
// display dialog
dialog.show();
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.widget.EditText;
import android.widget.TextView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.adapter.CartRecyclerviewItem;
/**
* ViewOrderDetailsActivity is used for display the order.
*/
public class ViewOrderDetailsActivity extends AppCompatActivity {
private RecyclerView mRecyclerView;
private LinearLayoutManager mLayoutManager;
private CartRecyclerviewItem mAdapter;
private Intent intent;
private TextView textViewShoppingCartOrderId;
private EditText editTextShoppingCartCouponCode;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_order_view_details);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("");
setSupportActionBar(toolbar);
init();
intent = getIntent();
textViewShoppingCartOrderId.setText(intent.getStringExtra("orderId"));
editTextShoppingCartCouponCode.setKeyListener(null);
}
private void init() {
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerViewItems);
editTextShoppingCartCouponCode = (EditText) findViewById(R.id.editTextShoppingCartCouponCode);
textViewShoppingCartOrderId = (TextView) findViewById(R.id.textViewShoppingCartOrderId);
mRecyclerView.setHasFixedSize(true);
mLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setLayoutManager(mLayoutManager);
mAdapter = new CartRecyclerviewItem();
mRecyclerView.setAdapter(mAdapter);
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.activity.AddToCartActivity;
import com.vsoft.ezdine.android.activity.ShoppingCart;
import com.vsoft.ezdine.android.model.OrderMenuModel;
import java.util.ArrayList;
/**
* To populate products into cart screen.
*/
public class CartRecyclerviewItem extends RecyclerView.Adapter<CartRecyclerviewItem.DataObjectHolder> {
public static float total = 0.00f;
Context context;
ArrayList<OrderMenuModel> dataArrayList;
ArrayList<OrderMenuModel> dataArrayListNew;
@Override
public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) {
context = parent.getContext();
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.recyclerview_food_item, parent, false);
DataObjectHolder dataObjectHolder = new DataObjectHolder(view);
dataArrayList = new ArrayList<>(StarterAdapter.getSelectedMap().values());
dataArrayListNew = new ArrayList<>(StarterAdapter.getSelectedMap().values());
return dataObjectHolder;
}
@Override
public void onBindViewHolder(final DataObjectHolder holder, final int position) {
if (dataArrayList.size() > 0) {
final OrderMenuModel model = dataArrayList.get(position);
holder.item.setText(model.getProductName());
holder.itemQuantity.setText("" + model.getProductQuantity());
holder.plusImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int sum = Integer.parseInt(holder.itemQuantity.getText().toString()) + 1;
holder.itemQuantity.setText(sum + "");
float totalItemPrice = Float.parseFloat(model.getProductPrice().replace("$", "").trim()) * sum;
holder.amount.setText("$" + totalItemPrice);
insertOrUpdateQuantity(model, sum, position);
((ShoppingCart) context).changeTotalAmout();
}
});
holder.minusImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int sum = Integer.parseInt(holder.itemQuantity.getText().toString()) - 1;
if (sum <= 0) {
sum = 1;
holder.itemQuantity.setText(sum + "");
}
holder.itemQuantity.setText(sum + "");
float totalItemPrice = Float.parseFloat(model.getProductPrice().replace("$", "").trim()) * sum;
holder.amount.setText("$" + totalItemPrice);
insertOrUpdateQuantity(model, sum, position);
((ShoppingCart) context).changeTotalAmout();
}
});
holder.price.setText("" + model.getProductPrice());
// calculateSelectedItemsAmout(position);
float totalItemPrice = Float.parseFloat(model.getProductPrice().replace("$", "").trim()) * model.getProductQuantity();
holder.amount.setText("$ " + totalItemPrice);
}
}
@Override
public int getItemCount() {
return StarterAdapter.getSelectedMap().size();
}
private void insertOrUpdateQuantity(OrderMenuModel orderMenuModel, int quantity, int position) {
if (quantity > 0) {
orderMenuModel.setProductQuantity(quantity);
StarterAdapter.getSelectedMap().put(orderMenuModel.getProductId(), orderMenuModel);
dataArrayList.set(position, orderMenuModel);
} else {
StarterAdapter.getSelectedMap().remove(orderMenuModel.getProductId());
}
}
/**
* To handle the instance of the visible items in recycler view.
*/
public static class DataObjectHolder extends RecyclerView.ViewHolder {
private TextView item, itemQuantity, price, amount;
private ImageView plusImage, minusImage;
/**
* To instantiate view holder.
*/
public DataObjectHolder(View itemView) {
super(itemView);
item = (TextView) itemView.findViewById(R.id.orderItemName);
itemQuantity = (TextView) itemView.findViewById(R.id.orderItemQty);
price = (TextView) itemView.findViewById(R.id.ordersPrice);
amount = (TextView) itemView.findViewById(R.id.orderAmount);
plusImage = (ImageView) itemView.findViewById(R.id.shoppingCartIncrementQuantityImage);
minusImage = (ImageView) itemView.findViewById(R.id.shoppingCartDecrementQuantityImage);
}
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* Vsoft Consulting Corporation
* www.vsoftconsulting.com
*/
package com.vsoft.ezdine.android.adapter;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.media.ThumbnailUtils;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.MimeTypeMap;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.MapsInitializer;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.activity.RecyclerGridGalleryActivity;
import com.vsoft.ezdine.android.model.ChatModel;
import com.vsoft.ezdine.android.xmpputil.SupportedFileFormats;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
/**
* DeliveryBillingAdaptor is adaptro in delivery list items are set into row and diaplayed.
*/
public class ChatAdaptor extends RecyclerView.Adapter<ChatAdaptor.MyViewHolder> {
private final Context context;
private ArrayList<ChatModel> chatList;
private ArrayList<String> imageList = new ArrayList<>();
/**
* DeliveryBillingAdaptor Adaptor is constructor of delivery billing list.
*/
public ChatAdaptor(Context context, ArrayList<ChatModel> chatList) {
this.context = context;
this.chatList = chatList;
}
@Override
public ChatAdaptor.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.chat_adapter,
parent, false);
return new MyViewHolder(view);
}
private String formatTime(long milliSeconds) {
DateFormat formatter = new SimpleDateFormat("MM-dd-yyyy hh:mm a");
System.out.println(milliSeconds);
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(milliSeconds);
return formatter.format(calendar.getTime());
}
@Override
public void onBindViewHolder(ChatAdaptor.MyViewHolder holder, int position) {
final ChatModel model = chatList.get(position);
holder.time.setText(formatTime(Long.parseLong(model.getTime())));
if (model.getMssageType() == ChatModel.MessageType.SENT) {
holder.messageLayout.setBackgroundResource(R.drawable.grey_bubble);
holder.msg.setTextColor(Color.BLACK);
holder.time.setTextColor(Color.BLACK);
} else if (model.getMssageType() == ChatModel.MessageType.RECEIVED) {
holder.messageLayout.setBackgroundResource(R.drawable.purple_bubble);
holder.msg.setTextColor(Color.WHITE);
holder.time.setTextColor(Color.WHITE);
}
if (model.getMessageCategory().equalsIgnoreCase("Text")) {
holder.msg.setVisibility(View.VISIBLE);
holder.media.setVisibility(View.GONE);
holder.video.setVisibility(View.GONE);
holder.msg.setText(model.getMessage());
holder.mapview.setVisibility(View.GONE);
} else if (model.getMessageCategory().equalsIgnoreCase("Attachment")) {
if (model.getFileType().equalsIgnoreCase("Image")) {
holder.video.setVisibility(View.GONE);
holder.mapview.setVisibility(View.GONE);
holder.msg.setVisibility(View.GONE);
holder.media.setVisibility(View.VISIBLE);
holder.media.setImageBitmap(BitmapFactory.decodeFile(model.getFilePath()));
imageList.add(model.getFilePath());
holder.media.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(context, RecyclerGridGalleryActivity.class);
intent.putExtra("position", imageList.indexOf(model.getFilePath()));
intent.putExtra("IMAGE_PATH_LIST", imageList);
intent.putExtra("IS_RESOURCE", false);
context.startActivity(intent);
}
});
} else if (model.getFileType().equalsIgnoreCase("Document")) {
holder.mapview.setVisibility(View.GONE);
holder.video.setVisibility(View.GONE);
holder.msg.setVisibility(View.GONE);
holder.media.setVisibility(View.VISIBLE);
holder.media.setImageResource(R.drawable.document);
holder.media.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Toast.makeText(context, "Under Development", Toast.LENGTH_SHORT).show();
openFile(model.getFilePath());
}
});
} else if (model.getFileType().equalsIgnoreCase("Audio")) {
holder.mapview.setVisibility(View.GONE);
holder.msg.setVisibility(View.GONE);
holder.video.setVisibility(View.VISIBLE);
holder.media.setVisibility(View.VISIBLE);
holder.media.setImageResource(R.drawable.headphones);
holder.media.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Toast.makeText(context, "Under Development", Toast.LENGTH_SHORT).show();
openFile(model.getFilePath());
}
});
} else if (model.getFileType().equalsIgnoreCase("Video")) {
Bitmap thumbnail = ThumbnailUtils.createVideoThumbnail(model.getFilePath(),
MediaStore.Images.Thumbnails.MINI_KIND);
holder.mapview.setVisibility(View.GONE);
holder.msg.setVisibility(View.GONE);
holder.media.setVisibility(View.VISIBLE);
holder.video.setImageResource(R.drawable.play);
holder.video.setVisibility(View.VISIBLE);
holder.media.setImageBitmap(thumbnail);
holder.media.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Toast.makeText(context, "Under Development", Toast.LENGTH_SHORT).show();
openFile(model.getFilePath());
}
});
}
} else if (model.getMessageCategory().equalsIgnoreCase("Location")) {
if (model.getMessage() != null && model.getMessage().length() > 0) {
final String[] latlng = model.getMessage().split("~");
holder.msg.setVisibility(View.GONE);
holder.media.setVisibility(View.GONE);
holder.video.setVisibility(View.GONE);
holder.mapview.setVisibility(View.VISIBLE);
holder.mapview.onCreate(null);
holder.mapview.getMapAsync(new MapReadyCallBack(Double.parseDouble(latlng[0]), Double.parseDouble(latlng[1])));
//awPolyLineOnMap();
try {
MapsInitializer.initialize(context);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
private void openFile(String path) {
MimeTypeMap myMime = MimeTypeMap.getSingleton();
Intent newIntent = new Intent(Intent.ACTION_VIEW);
String extension = SupportedFileFormats.fetchFileExtension(path);
String mimeType = myMime.getMimeTypeFromExtension(extension);
newIntent.setDataAndType(Uri.fromFile(new File(path)), mimeType);
newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
context.startActivity(newIntent);
} catch (ActivityNotFoundException e) {
Toast.makeText(context, "No handler for this type of file.", Toast.LENGTH_LONG).show();
}
}
@Override
public int getItemCount() {
return chatList.size();
}
private class MapReadyCallBack implements OnMapReadyCallback {
private double latitude, longitude;
public MapReadyCallBack(double latitude, double longitude) {
this.latitude = latitude;
this.longitude = longitude;
}
@Override
public void onMapReady(GoogleMap googleMap) {
googleMap.getUiSettings().setAllGesturesEnabled(false);
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), 10f));
googleMap.addMarker(new MarkerOptions()
.position(new LatLng(latitude, longitude))
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE)));
}
}
/**
* MyViewHolder class of textview and images ,radio buttons for the adaptor.
*/
public class MyViewHolder extends RecyclerView.ViewHolder {
/**
* MyViewHolder is used for intilization.
*/
TextView msg, time;
ImageView media, video;
MapView mapview;
private RelativeLayout messageLayout;
public MyViewHolder(View itemView) {
super(itemView);
msg = (TextView) itemView.findViewById(R.id.message);
time = (TextView) itemView.findViewById(R.id.time);
video = (ImageView) itemView.findViewById(R.id.video);
media = (ImageView) itemView.findViewById(R.id.media);
mapview = (MapView) itemView.findViewById(R.id.mapview);
messageLayout = (RelativeLayout) itemView.findViewById(R.id.messageLayout);
}
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* Vsoft Consulting Corporation
* www.vsoftconsulting.com
*/
package com.vsoft.ezdine.android.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;
import com.vsoft.ezdine.android.R;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class CitiesAddressAdapter extends BaseExpandableListAdapter {
private Context context;
private ArrayList<String> mListDataGroup;
private HashMap<String, List<String>> mListDataChild;
public CitiesAddressAdapter(Context context, ArrayList<String> expandableListTitle, HashMap<String, List<String>> mListDataChild) {
this.context = context;
mListDataGroup = expandableListTitle;
this.mListDataChild = mListDataChild;
}
@Override
public int getGroupCount() {
return mListDataGroup.size();
}
@Override
public int getChildrenCount(int listPosition) {
return mListDataChild.get(mListDataGroup.get(listPosition)).size();
}
@Override
public Object getGroup(int listPosition) {
return mListDataGroup.get(listPosition);
}
@Override
public Object getChild(int listPosition, int expandedListPosition) {
return mListDataChild.get(mListDataChild.get(listPosition)).get(expandedListPosition);
}
@Override
public long getGroupId(int listPosition) {
return listPosition;
}
@Override
public long getChildId(int listPosition, int expandedListPosition) {
return expandedListPosition;
}
@Override
public boolean hasStableIds() {
return false;
}
@Override
public View getGroupView(int listPosition, boolean isExpanded, View convertView, ViewGroup parent) {
String listTitle = (String) getGroup(listPosition);
if (convertView == null) {
LayoutInflater layoutInflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = layoutInflater.inflate(R.layout.list_group, null);
}
TextView expandedListTextView = (TextView) convertView.findViewById(R.id.listTitle);
expandedListTextView.setText(listTitle);
return convertView;
}
@Override
public View getChildView(int listPosition, final int expandedListPosition, boolean isLastChild, View convertView, ViewGroup parent) {
final String expandedListText = (String) getChild(listPosition, expandedListPosition);
if (convertView == null) {
LayoutInflater layoutInflater = (LayoutInflater) this.context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = layoutInflater.inflate(R.layout.list_items, null);
}
TextView expandedListTextView = (TextView) convertView.findViewById(R.id.expandedListItem);
expandedListTextView.setText(expandedListText);
return convertView;
}
@Override
public boolean isChildSelectable(int listPosition, int expandedListPosition) {
return true;
}
/*setContentView(R.layout.activity_cities_address_adapter);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);*/
}
package com.vsoft.ezdine.android.adapter;
import android.content.Context;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.activity.RecyclerGridGalleryActivity;
import java.util.ArrayList;
/**
* Created by pareti on 17-Nov-16.
*/
public class CustomPagerAdapter extends RecyclerView.Adapter<CustomPagerAdapter.MyViewHolder> {
private Context mContext;
private boolean isResources = true;
private ArrayList<String> imagePathList;
public CustomPagerAdapter(Context context, boolean isResources, ArrayList<String>
imagePathList) {
mContext = context;
this.isResources = isResources;
this.imagePathList = imagePathList;
}
@Override
public CustomPagerAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.pager_item, parent, false);
return new MyViewHolder(itemView);
}
@Override
public void onBindViewHolder(CustomPagerAdapter.MyViewHolder holder, final int position) {
if (isResources) {
holder.imageView.setImageResource(Integer.parseInt(imagePathList.get(position)));
} else {
holder.imageView.setImageBitmap(BitmapFactory.decodeFile(imagePathList.get(position)));
}
holder.imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(mContext, RecyclerGridGalleryActivity.class);
intent.putExtra("position", position);
intent.putExtra("IMAGE_PATH_LIST", imagePathList);
intent.putExtra("IS_RESOURCE", isResources);
mContext.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return imagePathList.size();
}
public class MyViewHolder extends RecyclerView.ViewHolder {
private ImageView imageView;
public MyViewHolder(View itemView) {
super(itemView);
imageView = (ImageView) itemView.findViewById(R.id.resDetImageView);
}
}
}
\ No newline at end of file
package com.vsoft.ezdine.android.adapter;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import com.vsoft.ezdine.android.R;
import java.util.ArrayList;
/**
* Created by pareti on 17-Nov-16.
*/
public class CustomPagerAdapterGrid extends android.support.v4.view.PagerAdapter {
private Context mContext;
private LayoutInflater mLayoutInflater;
private boolean isResources = true;
private ArrayList<String> imagePathList;
public CustomPagerAdapterGrid(Context context, boolean isResources, ArrayList<String>
imagePathList) {
mContext = context;
mLayoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.isResources = isResources;
this.imagePathList = imagePathList;
}
@Override
public int getCount() {
return imagePathList.size();
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view == object;
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
View itemView = mLayoutInflater.inflate(R.layout.pager_item_grid, container, false);
ImageView imageView = (ImageView) itemView.findViewById(R.id.resDetImageView);
if (isResources) {
imageView.setImageResource(Integer.parseInt(imagePathList.get(position)));
} else {
imageView.setImageBitmap(BitmapFactory.decodeFile(imagePathList.get(position)));
}
container.addView(itemView, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
return itemView;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((View) object);
}
}
\ No newline at end of file
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.model.DeliveryBillingModel;
import java.util.ArrayList;
/**
* DeliveryBillingAdaptor is adaptro in delivery list items are set into row and diaplayed.
*/
public class DeliveryBillingAdaptor extends RecyclerView.Adapter<DeliveryBillingAdaptor.MyViewHolder> {
private final Context context;
private ArrayList<DeliveryBillingModel> deliveryAddressList;
private int mSelectedItem = 1;
/**
* DeliveryBillingAdaptor Adaptor is constructor of delivery billing list.
*/
public DeliveryBillingAdaptor(Context context, ArrayList<DeliveryBillingModel> deliveryAddressList) {
this.context = context;
this.deliveryAddressList = deliveryAddressList;
}
@Override
public DeliveryBillingAdaptor.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.content_delivery_billing, parent, false);
return new MyViewHolder(view);
}
@Override
public void onBindViewHolder(DeliveryBillingAdaptor.MyViewHolder holder, int position) {
holder.addressName.setText(deliveryAddressList.get(position).getDeliveryName());
holder.addressImage.setImageDrawable(deliveryAddressList.get(position).getAddressImage());
holder.deliveryAddressName.setText(deliveryAddressList.get(position).getDeliveryAddress());
holder.deliveryCity.setText(deliveryAddressList.get(position).getDeliveryCity());
holder.deliveryCharges.setText(deliveryAddressList.get(position).getDeliveryCharges());
holder.deliveryAddressCheck.setChecked(position == mSelectedItem);
}
@Override
public int getItemCount() {
return deliveryAddressList.size();
}
/**
* MyViewHolder class of textview and images ,radio buttons for the adaptor.
*/
public class MyViewHolder extends RecyclerView.ViewHolder {
private final ImageView addressImage;
private final TextView addressName;
private final TextView deliveryAddressName;
private final TextView deliveryCity;
private final TextView deliveryCharges;
private RadioButton deliveryAddressCheck;
/**
* MyViewHolder is used for intilization.
*/
public MyViewHolder(View itemView) {
super(itemView);
addressImage = (ImageView) itemView.findViewById(R.id.delivery_image);
addressName = (TextView) itemView.findViewById(R.id.delivery_address_name);
deliveryAddressName = (TextView) itemView.findViewById(R.id.delivery_total_address);
deliveryCity = (TextView) itemView.findViewById(R.id.delivery_city);
deliveryCharges = (TextView) itemView.findViewById(R.id.delivery_charges);
deliveryAddressCheck = (RadioButton) itemView.findViewById(R.id.delivery_radioButton);
View.OnClickListener listener = new View.OnClickListener() {
@Override
public void onClick(View v) {
mSelectedItem = getAdapterPosition();
notifyItemRangeChanged(0, deliveryAddressList.size());
}
};
itemView.setOnClickListener(listener);
deliveryAddressCheck.setOnClickListener(listener);
}
}
}
/*
* opyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* Vsoft Consulting Corporation
* www.vsoftconsulting.com
*/
package com.vsoft.ezdine.android.adapter;
/**
* Created by dbhat on 15-03-2016.
*/
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.TextView;
import com.vsoft.ezdine.android.R;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
// Eclipse wanted me to use a sparse array instead of my hashmaps, I just suppressed that suggestion
@SuppressLint("UseSparseArrays")
public class FoodCategoryExpAdapter extends BaseExpandableListAdapter {
private Context mContext;
private HashMap<String, List<String>> mListDataChild;
private ArrayList<String> mListDataGroup;
private HashMap<Integer, boolean[]> mChildCheckStates;
private ChildViewHolder childViewHolder;
private GroupViewHolder groupViewHolder;
private String groupText;
private String childText;
private boolean isCheckValue = false;
/* Here's the constructor we'll use to pass in our calling
* activity's context, group items, and child items
*/
public FoodCategoryExpAdapter(Context context, ArrayList<String> listDataGroup, HashMap<String, List<String>>
listDataChild, boolean isCheckValue) {
mContext = context;
mListDataGroup = listDataGroup;
this.mListDataChild = listDataChild;
this.isCheckValue = isCheckValue;
// Initialize our hashmap containing our check states here
mChildCheckStates = new HashMap<Integer, boolean[]>();
}
public int getNumberOfCheckedItemsInGroup(int mGroupPosition) {
boolean getChecked[] = mChildCheckStates.get(mGroupPosition);
int count = 0;
if (getChecked != null) {
for (int j = 0; j < getChecked.length; ++j) {
if (getChecked[j] == true) count++;
}
}
return count;
}
@Override
public int getGroupCount() {
return mListDataGroup.size();
}
/*
* This defaults to "public object getGroup" if you auto import the methods
* I've always make a point to change it from "object" to whatever item
* I passed through the constructor
*/
@Override
public String getGroup(int groupPosition) {
return mListDataGroup.get(groupPosition);
}
@Override
public long getGroupId(int groupPosition) {
return groupPosition;
}
@Override
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
groupText = getGroup(groupPosition);
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.list_group, null);
// Initialize the GroupViewHolder defined at the bottom of this document
groupViewHolder = new GroupViewHolder();
groupViewHolder.mGroupText = (TextView) convertView.findViewById(R.id.listTitle);
convertView.setTag(groupViewHolder);
} else {
groupViewHolder = (GroupViewHolder) convertView.getTag();
}
groupViewHolder.mGroupText.setText(groupText);
return convertView;
}
@Override
public int getChildrenCount(int groupPosition) {
return mListDataChild.get(mListDataGroup.get(groupPosition)).size();
}
@Override
public String getChild(int groupPosition, int childPosition) {
return mListDataChild.get(mListDataGroup.get(groupPosition)).get(childPosition);
}
@Override
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
final int mGroupPosition = groupPosition;
final int mChildPosition = childPosition;
childText = getChild(mGroupPosition, mChildPosition);
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) this.mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.list_item_food_category, null);
childViewHolder = new ChildViewHolder();
childViewHolder.mChildText = (TextView) convertView
.findViewById(R.id.lblListItem);
childViewHolder.mCheckBox = (CheckBox) convertView
.findViewById(R.id.lstcheckBox);
convertView.setTag(R.layout.list_item, childViewHolder);
} else {
childViewHolder = (ChildViewHolder) convertView
.getTag(R.layout.list_item);
}
childViewHolder.mChildText.setText(childText);
childViewHolder.mCheckBox.setOnCheckedChangeListener(null);
if (mChildCheckStates.containsKey(mGroupPosition)) {
boolean getChecked[] = mChildCheckStates.get(mGroupPosition);
// boolean value of getChecked[position]
childViewHolder.mCheckBox.setChecked(getChecked[mChildPosition]);
} else {
boolean getChecked[] = new boolean[getChildrenCount(mGroupPosition)];
// add getChecked[] to the mChildCheckStates hashmap using mGroupPosition as the key
mChildCheckStates.put(mGroupPosition, getChecked);
// boolean value of getChecked[position]
childViewHolder.mCheckBox.setChecked(false);
}
childViewHolder.mCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
boolean getChecked[] = mChildCheckStates.get(mGroupPosition);
getChecked[mChildPosition] = isChecked;
mChildCheckStates.put(mGroupPosition, getChecked);
} else {
boolean getChecked[] = mChildCheckStates.get(mGroupPosition);
getChecked[mChildPosition] = isChecked;
mChildCheckStates.put(mGroupPosition, getChecked);
}
}
});
if (isCheckValue == true) {
boolean getChecked[] = mChildCheckStates.get(mGroupPosition);
mChildCheckStates.put(mGroupPosition, getChecked);
}
return convertView;
}
@Override
public void notifyDataSetChanged() {
super.notifyDataSetChanged();
}
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
return false;
}
@Override
public boolean hasStableIds() {
return false;
}
public final class GroupViewHolder {
TextView mGroupText;
}
public final class ChildViewHolder {
TextView mChildText;
CheckBox mCheckBox;
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.adapter;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.activity.ViewOrderDetailsActivity;
import com.vsoft.ezdine.android.model.MyOrdersModel;
import java.util.ArrayList;
/**
* MyOrdersViewAdapter for display the Order List.
*/
public class MyOrdersViewAdapter extends RecyclerView.Adapter<MyOrdersViewAdapter.MyOrdersViewHolder> {
private Context context;
private ArrayList<MyOrdersModel> myOrdersModelArrayList;
/**
* Create constructor for add the items in to activity.
*
* @param context
* @param myOrdersModelArrayList
*/
public MyOrdersViewAdapter(Context context, ArrayList<MyOrdersModel> myOrdersModelArrayList) {
this.context = context;
this.myOrdersModelArrayList = myOrdersModelArrayList;
}
@Override
public int getItemCount() {
return (null != myOrdersModelArrayList ? myOrdersModelArrayList.size() : 0);
}
@Override
public void onBindViewHolder(MyOrdersViewHolder holder, final int position) {
final MyOrdersModel model = myOrdersModelArrayList.get(position);
MyOrdersViewAdapter.MyOrdersViewHolder mainHolder = holder;
mainHolder.ordrDate.setText(model.getOrderDate());
mainHolder.ordrDelivered.setText(model.getOrderDelivary());
mainHolder.ordrTotal.setText(model.getOrderTotal());
mainHolder.ordrStatus.setText(model.getOrderStatus());
mainHolder.orderId.setText(model.getOrderId());
mainHolder.viewOrderBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//view.getContext().startActivity(new Intent(context,ViewOrderDetailsActivity.class));
Intent intent = new Intent(view.getContext(), ViewOrderDetailsActivity.class);
intent.putExtra("orderId", myOrdersModelArrayList.get(position).getOrderId());
view.getContext().startActivity(intent);
}
});
}
@Override
public MyOrdersViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext()).
inflate(R.layout.myorders_row_item, parent, false);
return new MyOrdersViewHolder(itemView);
}
/**
* MyOrdersViewHolder set the Items into ViewHolder.
*/
public class MyOrdersViewHolder extends RecyclerView.ViewHolder {
private TextView ordrDate, ordrDelivered, ordrTotal, ordrStatus, orderId;
private Button viewOrderBtn, reOrderBtn;
/**
* Intialize the ids and set into View Holder.
*
* @param view
*/
public MyOrdersViewHolder(View view) {
super(view);
ordrDate = (TextView) view.findViewById(R.id.date);
ordrDelivered = (TextView) view.findViewById(R.id.dlvrto);
ordrTotal = (TextView) view.findViewById(R.id.totalprc);
ordrStatus = (TextView) view.findViewById(R.id.statuss);
orderId = (TextView) view.findViewById(R.id.orderId);
viewOrderBtn = (Button) view.findViewById(R.id.viewPrder);
reOrderBtn = (Button) view.findViewById(R.id.reOrder);
}
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.adapter;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.activity.TrackOrderActivity;
import com.vsoft.ezdine.android.model.NotificationModel;
import java.util.ArrayList;
/**
* NotificationAdapter is used to populate the Notification details for the notifiction fragment.
*/
public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapter.MyViewHolder> {
private Context context;
private ArrayList<NotificationModel> notificationLists;
/**
* NotificationAdapter is constructor of notification arraylist.
*/
public NotificationAdapter(Context context, ArrayList<NotificationModel> notificationLists) {
this.context = context;
this.notificationLists = notificationLists;
}
@Override
public NotificationAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.activity_notification_adapter,
parent, false);
return new NotificationAdapter.MyViewHolder(view);
}
@Override
public void onBindViewHolder(NotificationAdapter.MyViewHolder holder, final int position) {
final NotificationModel notificationModel = notificationLists.get(position);
holder.orderStatus.setText(notificationLists.get(position).getOrderStatus());
holder.orderid.setText(notificationLists.get(position).getOrderDetail());
if (notificationLists.get(position).getOrderid().equals("general")) {
holder.viewOrder.setVisibility(View.GONE);
} else {
holder.viewOrder.setVisibility(View.VISIBLE);
}
holder.viewOrder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(view.getContext(), TrackOrderActivity.class);
intent.putExtra("ordersts", notificationLists.get(position).getOrderid());
view.getContext().startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return notificationLists.size();
}
/**
* MyViewHolder is class which textview and button are initalized.
*/
public class MyViewHolder extends RecyclerView.ViewHolder {
private final TextView orderStatus;
private final TextView orderid;
private final TextView orderTime;
private final Button viewOrder;
/**
* NotificationAdapter is used to initalize all the views.
*/
public MyViewHolder(View itemView) {
super(itemView);
orderStatus = (TextView) itemView.findViewById(R.id.order_status);
orderid = (TextView) itemView.findViewById(R.id.order_id);
orderTime = (TextView) itemView.findViewById(R.id.order_time_display);
viewOrder = (Button) itemView.findViewById(R.id.view_order);
}
}
}
/*
* Copyright © 2016 by Vsoft Consulting Corporation.
*
* All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by
* any means, including photocopying, recording, or other electronic or mechanical methods, without the prior
* written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain
* other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed
* “Attention: Permissions Coordinator,” at the address below.
*
* PTech Solutions Pvt. Ltd.
* www.vsoftconsulting.com/
*
*/
package com.vsoft.ezdine.android.adapter;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Paint;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.vsoft.ezdine.android.R;
import com.vsoft.ezdine.android.activity.SelectCouponActivity;
import com.vsoft.ezdine.android.model.OfferDealsModel;
import com.vsoft.ezdine.android.util.DimenUtil;
import com.vsoft.ezdine.android.util.ImageUtils;
import java.io.Serializable;
import java.util.ArrayList;
/**
* OfferDealsRecyclerAdapter is used for display the offers and Deals.
*/
public class OfferDealsRecyclerAdapter extends RecyclerView.Adapter<OfferDealsRecyclerAdapter.OfferViewHolder> {
private Context context;
private ArrayList<OfferDealsModel> offerDealsModelsArryList;
/**
* OfferDealsRecyclerAdapter for set the item into OfferDealsFragment.
*
* @param context
* @param offerDealsModelsArryList
*/
public OfferDealsRecyclerAdapter(Context context, ArrayList<OfferDealsModel> offerDealsModelsArryList) {
this.context = context;
this.offerDealsModelsArryList = offerDealsModelsArryList;
}
@Override
public int getItemCount() {
return (null != offerDealsModelsArryList ? offerDealsModelsArryList.size() : 0);
}
@Override
public void onBindViewHolder(OfferViewHolder holder, final int position) {
final OfferDealsModel model = offerDealsModelsArryList.get(position);
// holder
OfferDealsRecyclerAdapter.OfferViewHolder mainHolder = holder;
// This will convert drawbale image into bitmap
Bitmap image = ImageUtils.getInstance()
.decodeSampledBitmapFromResource(context, context.getResources(), model.getBiryaniImage(), DimenUtil.getInstance()
.dpToPx
(context, 100),
DimenUtil.getInstance().dpToPx(context, 100), true, true, false,
false);
// setting title
mainHolder.coupons.setText("Coupon Code :" + model.getCouponCode());
mainHolder.validDate.setText(model.getValidDate());
mainHolder.offerOne.setText(model.getOfferTextOne());
mainHolder.offerTwo.setText(model.getOfferTextTwo());
mainHolder.originalPrice.setText(model.getOriginalPrice());
mainHolder.originalPriceOne.setText(model.getOriginalPrice());
mainHolder.offerPrice.setText(model.getOfferPrice());
mainHolder.offerPriceOne.setText(model.getOfferPrice());
mainHolder.offerImage.setImageBitmap(image);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (context.getClass().equals(SelectCouponActivity.class)) {
System.out.println("position clicked:"+position);
((SelectCouponActivity) context).updateCoupon(offerDealsModelsArryList.get(position
).getCouponCode());
}
}
});
}
@Override
public OfferViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View itemView = LayoutInflater.from(viewGroup.getContext())
.inflate(R.layout.offer_details_item_row, viewGroup, false);
return new OfferViewHolder(itemView);
}
/**
* OfferViewHolder for intialize the item values through viewHolder.
*/
public class OfferViewHolder extends RecyclerView.ViewHolder {
private TextView coupons, validDate, offerOne, offerTwo, originalPrice, offerPrice;
private TextView originalPriceOne, offerPriceOne;
private ImageView offerImage;
/**
* OfferViewHolder for intialize the item values through ids..
*/
public OfferViewHolder(View view) {
super(view);
coupons = (TextView) view.findViewById(R.id.couponTxtVw);
validDate = (TextView) view.findViewById(R.id.validTxtVw);
offerOne = (TextView) view.findViewById(R.id.offerOneTxtVw);
offerTwo = (TextView) view.findViewById(R.id.offerOneTxtVw1);
originalPrice = (TextView) view.findViewById(R.id.orgPrcTxtVw);
originalPriceOne = (TextView) view.findViewById(R.id.orgPrcTxtVw1);
offerPrice = (TextView) view.findViewById(R.id.offerPriceTxtVw);
offerPriceOne = (TextView) view.findViewById(R.id.offerPriceTxtVw1);
offerImage = (ImageView) view.findViewById(R.id.image);
originalPrice.setPaintFlags(originalPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
originalPriceOne.setPaintFlags(originalPriceOne.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
}
}
}
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment