Showing
21 changed files
with
674 additions
and
248 deletions
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <project version="4"> | 2 | <project version="4"> |
3 | <component name="CompilerConfiguration"> | 3 | <component name="CompilerConfiguration"> |
4 | - <bytecodeTargetLevel target="11" /> | 4 | + <bytecodeTargetLevel target="17" /> |
5 | </component> | 5 | </component> |
6 | </project> | 6 | </project> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
8 | <option name="distributionType" value="DEFAULT_WRAPPED" /> | 8 | <option name="distributionType" value="DEFAULT_WRAPPED" /> |
9 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> | 9 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> |
10 | <option name="gradleHome" value="$PROJECT_DIR$/../../../../../../gradle-6.6.1" /> | 10 | <option name="gradleHome" value="$PROJECT_DIR$/../../../../../../gradle-6.6.1" /> |
11 | - <option name="gradleJvm" value="11" /> | 11 | + <option name="gradleJvm" value="jbr-17" /> |
12 | <option name="modules"> | 12 | <option name="modules"> |
13 | <set> | 13 | <set> |
14 | <option value="$PROJECT_DIR$" /> | 14 | <option value="$PROJECT_DIR$" /> | ... | ... |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
1 | <project version="4"> | 2 | <project version="4"> |
2 | <component name="DesignSurface"> | 3 | <component name="DesignSurface"> |
3 | <option name="filePathToZoomLevelMap"> | 4 | <option name="filePathToZoomLevelMap"> |
... | @@ -183,7 +184,7 @@ | ... | @@ -183,7 +184,7 @@ |
183 | </map> | 184 | </map> |
184 | </option> | 185 | </option> |
185 | </component> | 186 | </component> |
186 | - <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK"> | 187 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> |
187 | <output url="file://$PROJECT_DIR$/build/classes" /> | 188 | <output url="file://$PROJECT_DIR$/build/classes" /> |
188 | </component> | 189 | </component> |
189 | <component name="ProjectType"> | 190 | <component name="ProjectType"> | ... | ... |
... | @@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { | ... | @@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { |
36 | public void onWarplyReady() { | 36 | public void onWarplyReady() { |
37 | if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { | 37 | if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { |
38 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() | 38 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() |
39 | - .setGuid("7000000831"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910 | 39 | + .setGuid("7000000833"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910 |
40 | mLoginReceiver); | 40 | mLoginReceiver); |
41 | } else { | 41 | } else { |
42 | startNextActivity(); | 42 | startNextActivity(); | ... | ... |
No preview for this file type
1 | -#Wed Oct 30 10:10:22 EET 2019 | ||
2 | distributionBase=GRADLE_USER_HOME | 1 | distributionBase=GRADLE_USER_HOME |
3 | distributionPath=wrapper/dists | 2 | distributionPath=wrapper/dists |
3 | +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
4 | zipStoreBase=GRADLE_USER_HOME | 4 | zipStoreBase=GRADLE_USER_HOME |
5 | zipStorePath=wrapper/dists | 5 | zipStorePath=wrapper/dists |
6 | -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip | ... | ... |
gradlew
100644 → 100755
1 | -#!/usr/bin/env sh | 1 | +#!/bin/sh |
2 | 2 | ||
3 | # | 3 | # |
4 | -# Copyright 2015 the original author or authors. | 4 | +# Copyright © 2015-2021 the original authors. |
5 | # | 5 | # |
6 | # Licensed under the Apache License, Version 2.0 (the "License"); | 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
7 | # you may not use this file except in compliance with the License. | 7 | # you may not use this file except in compliance with the License. |
... | @@ -17,67 +17,101 @@ | ... | @@ -17,67 +17,101 @@ |
17 | # | 17 | # |
18 | 18 | ||
19 | ############################################################################## | 19 | ############################################################################## |
20 | -## | 20 | +# |
21 | -## Gradle start up script for UN*X | 21 | +# Gradle start up script for POSIX generated by Gradle. |
22 | -## | 22 | +# |
23 | +# Important for running: | ||
24 | +# | ||
25 | +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is | ||
26 | +# noncompliant, but you have some other compliant shell such as ksh or | ||
27 | +# bash, then to run this script, type that shell name before the whole | ||
28 | +# command line, like: | ||
29 | +# | ||
30 | +# ksh Gradle | ||
31 | +# | ||
32 | +# Busybox and similar reduced shells will NOT work, because this script | ||
33 | +# requires all of these POSIX shell features: | ||
34 | +# * functions; | ||
35 | +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», | ||
36 | +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; | ||
37 | +# * compound commands having a testable exit status, especially «case»; | ||
38 | +# * various built-in commands including «command», «set», and «ulimit». | ||
39 | +# | ||
40 | +# Important for patching: | ||
41 | +# | ||
42 | +# (2) This script targets any POSIX shell, so it avoids extensions provided | ||
43 | +# by Bash, Ksh, etc; in particular arrays are avoided. | ||
44 | +# | ||
45 | +# The "traditional" practice of packing multiple parameters into a | ||
46 | +# space-separated string is a well documented source of bugs and security | ||
47 | +# problems, so this is (mostly) avoided, by progressively accumulating | ||
48 | +# options in "$@", and eventually passing that to Java. | ||
49 | +# | ||
50 | +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, | ||
51 | +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; | ||
52 | +# see the in-line comments for details. | ||
53 | +# | ||
54 | +# There are tweaks for specific operating systems such as AIX, CygWin, | ||
55 | +# Darwin, MinGW, and NonStop. | ||
56 | +# | ||
57 | +# (3) This script is generated from the Groovy template | ||
58 | +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt | ||
59 | +# within the Gradle project. | ||
60 | +# | ||
61 | +# You can find Gradle at https://github.com/gradle/gradle/. | ||
62 | +# | ||
23 | ############################################################################## | 63 | ############################################################################## |
24 | 64 | ||
25 | # Attempt to set APP_HOME | 65 | # Attempt to set APP_HOME |
66 | + | ||
26 | # Resolve links: $0 may be a link | 67 | # Resolve links: $0 may be a link |
27 | -PRG="$0" | 68 | +app_path=$0 |
28 | -# Need this for relative symlinks. | 69 | + |
29 | -while [ -h "$PRG" ] ; do | 70 | +# Need this for daisy-chained symlinks. |
30 | - ls=`ls -ld "$PRG"` | 71 | +while |
31 | - link=`expr "$ls" : '.*-> \(.*\)$'` | 72 | + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path |
32 | - if expr "$link" : '/.*' > /dev/null; then | 73 | + [ -h "$app_path" ] |
33 | - PRG="$link" | 74 | +do |
34 | - else | 75 | + ls=$( ls -ld "$app_path" ) |
35 | - PRG=`dirname "$PRG"`"/$link" | 76 | + link=${ls#*' -> '} |
36 | - fi | 77 | + case $link in #( |
78 | + /*) app_path=$link ;; #( | ||
79 | + *) app_path=$APP_HOME$link ;; | ||
80 | + esac | ||
37 | done | 81 | done |
38 | -SAVED="`pwd`" | 82 | + |
39 | -cd "`dirname \"$PRG\"`/" >/dev/null | 83 | +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit |
40 | -APP_HOME="`pwd -P`" | ||
41 | -cd "$SAVED" >/dev/null | ||
42 | 84 | ||
43 | APP_NAME="Gradle" | 85 | APP_NAME="Gradle" |
44 | -APP_BASE_NAME=`basename "$0"` | 86 | +APP_BASE_NAME=${0##*/} |
45 | 87 | ||
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' | 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' |
48 | 90 | ||
49 | # Use the maximum available, or set MAX_FD != -1 to use that value. | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. |
50 | -MAX_FD="maximum" | 92 | +MAX_FD=maximum |
51 | 93 | ||
52 | warn () { | 94 | warn () { |
53 | echo "$*" | 95 | echo "$*" |
54 | -} | 96 | +} >&2 |
55 | 97 | ||
56 | die () { | 98 | die () { |
57 | echo | 99 | echo |
58 | echo "$*" | 100 | echo "$*" |
59 | echo | 101 | echo |
60 | exit 1 | 102 | exit 1 |
61 | -} | 103 | +} >&2 |
62 | 104 | ||
63 | # OS specific support (must be 'true' or 'false'). | 105 | # OS specific support (must be 'true' or 'false'). |
64 | cygwin=false | 106 | cygwin=false |
65 | msys=false | 107 | msys=false |
66 | darwin=false | 108 | darwin=false |
67 | nonstop=false | 109 | nonstop=false |
68 | -case "`uname`" in | 110 | +case "$( uname )" in #( |
69 | - CYGWIN* ) | 111 | + CYGWIN* ) cygwin=true ;; #( |
70 | - cygwin=true | 112 | + Darwin* ) darwin=true ;; #( |
71 | - ;; | 113 | + MSYS* | MINGW* ) msys=true ;; #( |
72 | - Darwin* ) | 114 | + NONSTOP* ) nonstop=true ;; |
73 | - darwin=true | ||
74 | - ;; | ||
75 | - MINGW* ) | ||
76 | - msys=true | ||
77 | - ;; | ||
78 | - NONSTOP* ) | ||
79 | - nonstop=true | ||
80 | - ;; | ||
81 | esac | 115 | esac |
82 | 116 | ||
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar |
... | @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ... | @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar |
87 | if [ -n "$JAVA_HOME" ] ; then | 121 | if [ -n "$JAVA_HOME" ] ; then |
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then |
89 | # IBM's JDK on AIX uses strange locations for the executables | 123 | # IBM's JDK on AIX uses strange locations for the executables |
90 | - JAVACMD="$JAVA_HOME/jre/sh/java" | 124 | + JAVACMD=$JAVA_HOME/jre/sh/java |
91 | else | 125 | else |
92 | - JAVACMD="$JAVA_HOME/bin/java" | 126 | + JAVACMD=$JAVA_HOME/bin/java |
93 | fi | 127 | fi |
94 | if [ ! -x "$JAVACMD" ] ; then | 128 | if [ ! -x "$JAVACMD" ] ; then |
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME |
... | @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the | ... | @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the |
98 | location of your Java installation." | 132 | location of your Java installation." |
99 | fi | 133 | fi |
100 | else | 134 | else |
101 | - JAVACMD="java" | 135 | + JAVACMD=java |
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
103 | 137 | ||
104 | Please set the JAVA_HOME variable in your environment to match the | 138 | Please set the JAVA_HOME variable in your environment to match the |
... | @@ -106,80 +140,95 @@ location of your Java installation." | ... | @@ -106,80 +140,95 @@ location of your Java installation." |
106 | fi | 140 | fi |
107 | 141 | ||
108 | # Increase the maximum file descriptors if we can. | 142 | # Increase the maximum file descriptors if we can. |
109 | -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | 143 | +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then |
110 | - MAX_FD_LIMIT=`ulimit -H -n` | 144 | + case $MAX_FD in #( |
111 | - if [ $? -eq 0 ] ; then | 145 | + max*) |
112 | - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | 146 | + MAX_FD=$( ulimit -H -n ) || |
113 | - MAX_FD="$MAX_FD_LIMIT" | 147 | + warn "Could not query maximum file descriptor limit" |
114 | - fi | 148 | + esac |
115 | - ulimit -n $MAX_FD | 149 | + case $MAX_FD in #( |
116 | - if [ $? -ne 0 ] ; then | 150 | + '' | soft) :;; #( |
117 | - warn "Could not set maximum file descriptor limit: $MAX_FD" | 151 | + *) |
118 | - fi | 152 | + ulimit -n "$MAX_FD" || |
119 | - else | 153 | + warn "Could not set maximum file descriptor limit to $MAX_FD" |
120 | - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | 154 | + esac |
121 | - fi | ||
122 | fi | 155 | fi |
123 | 156 | ||
124 | -# For Darwin, add options to specify how the application appears in the dock | 157 | +# Collect all arguments for the java command, stacking in reverse order: |
125 | -if $darwin; then | 158 | +# * args from the command line |
126 | - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | 159 | +# * the main class name |
127 | -fi | 160 | +# * -classpath |
161 | +# * -D...appname settings | ||
162 | +# * --module-path (only if needed) | ||
163 | +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. | ||
128 | 164 | ||
129 | # For Cygwin or MSYS, switch paths to Windows format before running java | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java |
130 | -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then | 166 | +if "$cygwin" || "$msys" ; then |
131 | - APP_HOME=`cygpath --path --mixed "$APP_HOME"` | 167 | + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) |
132 | - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | 168 | + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) |
133 | - | 169 | + |
134 | - JAVACMD=`cygpath --unix "$JAVACMD"` | 170 | + JAVACMD=$( cygpath --unix "$JAVACMD" ) |
135 | - | 171 | + |
136 | - # We build the pattern for arguments to be converted via cygpath | ||
137 | - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | ||
138 | - SEP="" | ||
139 | - for dir in $ROOTDIRSRAW ; do | ||
140 | - ROOTDIRS="$ROOTDIRS$SEP$dir" | ||
141 | - SEP="|" | ||
142 | - done | ||
143 | - OURCYGPATTERN="(^($ROOTDIRS))" | ||
144 | - # Add a user-defined pattern to the cygpath arguments | ||
145 | - if [ "$GRADLE_CYGPATTERN" != "" ] ; then | ||
146 | - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | ||
147 | - fi | ||
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh |
149 | - i=0 | 173 | + for arg do |
150 | - for arg in "$@" ; do | 174 | + if |
151 | - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | 175 | + case $arg in #( |
152 | - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | 176 | + -*) false ;; # don't mess with options #( |
153 | - | 177 | + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath |
154 | - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | 178 | + [ -e "$t" ] ;; #( |
155 | - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | 179 | + *) false ;; |
156 | - else | 180 | + esac |
157 | - eval `echo args$i`="\"$arg\"" | 181 | + then |
182 | + arg=$( cygpath --path --ignore --mixed "$arg" ) | ||
158 | fi | 183 | fi |
159 | - i=`expr $i + 1` | 184 | + # Roll the args list around exactly as many times as the number of |
185 | + # args, so each arg winds up back in the position where it started, but | ||
186 | + # possibly modified. | ||
187 | + # | ||
188 | + # NB: a `for` loop captures its iteration list before it begins, so | ||
189 | + # changing the positional parameters here affects neither the number of | ||
190 | + # iterations, nor the values presented in `arg`. | ||
191 | + shift # remove old arg | ||
192 | + set -- "$@" "$arg" # push replacement arg | ||
160 | done | 193 | done |
161 | - case $i in | ||
162 | - 0) set -- ;; | ||
163 | - 1) set -- "$args0" ;; | ||
164 | - 2) set -- "$args0" "$args1" ;; | ||
165 | - 3) set -- "$args0" "$args1" "$args2" ;; | ||
166 | - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; | ||
167 | - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | ||
168 | - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | ||
169 | - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | ||
170 | - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | ||
171 | - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | ||
172 | - esac | ||
173 | fi | 194 | fi |
174 | 195 | ||
175 | -# Escape application args | 196 | +# Collect all arguments for the java command; |
176 | -save () { | 197 | +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of |
177 | - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | 198 | +# shell script including quotes and variable substitutions, so put them in |
178 | - echo " " | 199 | +# double quotes to make sure that they get re-expanded; and |
179 | -} | 200 | +# * put everything else in single quotes, so that it's not re-expanded. |
180 | -APP_ARGS=`save "$@"` | 201 | + |
202 | +set -- \ | ||
203 | + "-Dorg.gradle.appname=$APP_BASE_NAME" \ | ||
204 | + -classpath "$CLASSPATH" \ | ||
205 | + org.gradle.wrapper.GradleWrapperMain \ | ||
206 | + "$@" | ||
207 | + | ||
208 | +# Use "xargs" to parse quoted args. | ||
209 | +# | ||
210 | +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. | ||
211 | +# | ||
212 | +# In Bash we could simply go: | ||
213 | +# | ||
214 | +# readarray ARGS < <( xargs -n1 <<<"$var" ) && | ||
215 | +# set -- "${ARGS[@]}" "$@" | ||
216 | +# | ||
217 | +# but POSIX shell has neither arrays nor command substitution, so instead we | ||
218 | +# post-process each arg (as a line of input to sed) to backslash-escape any | ||
219 | +# character that might be a shell metacharacter, then use eval to reverse | ||
220 | +# that process (while maintaining the separation between arguments), and wrap | ||
221 | +# the whole thing up as a single "set" statement. | ||
222 | +# | ||
223 | +# This will of course break if any of these variables contains a newline or | ||
224 | +# an unmatched quote. | ||
225 | +# | ||
181 | 226 | ||
182 | -# Collect all arguments for the java command, following the shell quoting and substitution rules | 227 | +eval "set -- $( |
183 | -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" | 228 | + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | |
229 | + xargs -n1 | | ||
230 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | | ||
231 | + tr '\n' ' ' | ||
232 | + )" '"$@"' | ||
184 | 233 | ||
185 | exec "$JAVACMD" "$@" | 234 | exec "$JAVACMD" "$@" | ... | ... |
1 | -@rem | 1 | +@rem |
2 | -@rem Copyright 2015 the original author or authors. | 2 | +@rem Copyright 2015 the original author or authors. |
3 | -@rem | 3 | +@rem |
4 | -@rem Licensed under the Apache License, Version 2.0 (the "License"); | 4 | +@rem Licensed under the Apache License, Version 2.0 (the "License"); |
5 | -@rem you may not use this file except in compliance with the License. | 5 | +@rem you may not use this file except in compliance with the License. |
6 | -@rem You may obtain a copy of the License at | 6 | +@rem You may obtain a copy of the License at |
7 | -@rem | 7 | +@rem |
8 | -@rem https://www.apache.org/licenses/LICENSE-2.0 | 8 | +@rem https://www.apache.org/licenses/LICENSE-2.0 |
9 | -@rem | 9 | +@rem |
10 | -@rem Unless required by applicable law or agreed to in writing, software | 10 | +@rem Unless required by applicable law or agreed to in writing, software |
11 | -@rem distributed under the License is distributed on an "AS IS" BASIS, | 11 | +@rem distributed under the License is distributed on an "AS IS" BASIS, |
12 | -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | -@rem See the License for the specific language governing permissions and | 13 | +@rem See the License for the specific language governing permissions and |
14 | -@rem limitations under the License. | 14 | +@rem limitations under the License. |
15 | -@rem | 15 | +@rem |
16 | - | 16 | + |
17 | -@if "%DEBUG%" == "" @echo off | 17 | +@if "%DEBUG%" == "" @echo off |
18 | -@rem ########################################################################## | 18 | +@rem ########################################################################## |
19 | -@rem | 19 | +@rem |
20 | -@rem Gradle startup script for Windows | 20 | +@rem Gradle startup script for Windows |
21 | -@rem | 21 | +@rem |
22 | -@rem ########################################################################## | 22 | +@rem ########################################################################## |
23 | - | 23 | + |
24 | -@rem Set local scope for the variables with windows NT shell | 24 | +@rem Set local scope for the variables with windows NT shell |
25 | -if "%OS%"=="Windows_NT" setlocal | 25 | +if "%OS%"=="Windows_NT" setlocal |
26 | - | 26 | + |
27 | -set DIRNAME=%~dp0 | 27 | +set DIRNAME=%~dp0 |
28 | -if "%DIRNAME%" == "" set DIRNAME=. | 28 | +if "%DIRNAME%" == "" set DIRNAME=. |
29 | -set APP_BASE_NAME=%~n0 | 29 | +set APP_BASE_NAME=%~n0 |
30 | -set APP_HOME=%DIRNAME% | 30 | +set APP_HOME=%DIRNAME% |
31 | - | 31 | + |
32 | -@rem Resolve any "." and ".." in APP_HOME to make it shorter. | 32 | +@rem Resolve any "." and ".." in APP_HOME to make it shorter. |
33 | -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi | 33 | +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi |
34 | - | 34 | + |
35 | -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | 35 | +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
36 | -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" | 36 | +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" |
37 | - | 37 | + |
38 | -@rem Find java.exe | 38 | +@rem Find java.exe |
39 | -if defined JAVA_HOME goto findJavaFromJavaHome | 39 | +if defined JAVA_HOME goto findJavaFromJavaHome |
40 | - | 40 | + |
41 | -set JAVA_EXE=java.exe | 41 | +set JAVA_EXE=java.exe |
42 | -%JAVA_EXE% -version >NUL 2>&1 | 42 | +%JAVA_EXE% -version >NUL 2>&1 |
43 | -if "%ERRORLEVEL%" == "0" goto init | 43 | +if "%ERRORLEVEL%" == "0" goto execute |
44 | - | 44 | + |
45 | -echo. | 45 | +echo. |
46 | -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | 46 | +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
47 | -echo. | 47 | +echo. |
48 | -echo Please set the JAVA_HOME variable in your environment to match the | 48 | +echo Please set the JAVA_HOME variable in your environment to match the |
49 | -echo location of your Java installation. | 49 | +echo location of your Java installation. |
50 | - | 50 | + |
51 | -goto fail | 51 | +goto fail |
52 | - | 52 | + |
53 | -:findJavaFromJavaHome | 53 | +:findJavaFromJavaHome |
54 | -set JAVA_HOME=%JAVA_HOME:"=% | 54 | +set JAVA_HOME=%JAVA_HOME:"=% |
55 | -set JAVA_EXE=%JAVA_HOME%/bin/java.exe | 55 | +set JAVA_EXE=%JAVA_HOME%/bin/java.exe |
56 | - | 56 | + |
57 | -if exist "%JAVA_EXE%" goto init | 57 | +if exist "%JAVA_EXE%" goto execute |
58 | - | 58 | + |
59 | -echo. | 59 | +echo. |
60 | -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | 60 | +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% |
61 | -echo. | 61 | +echo. |
62 | -echo Please set the JAVA_HOME variable in your environment to match the | 62 | +echo Please set the JAVA_HOME variable in your environment to match the |
63 | -echo location of your Java installation. | 63 | +echo location of your Java installation. |
64 | - | 64 | + |
65 | -goto fail | 65 | +goto fail |
66 | - | 66 | + |
67 | -:init | 67 | +:execute |
68 | -@rem Get command-line arguments, handling Windows variants | 68 | +@rem Setup the command line |
69 | - | 69 | + |
70 | -if not "%OS%" == "Windows_NT" goto win9xME_args | 70 | +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar |
71 | - | 71 | + |
72 | -:win9xME_args | 72 | + |
73 | -@rem Slurp the command line arguments. | 73 | +@rem Execute Gradle |
74 | -set CMD_LINE_ARGS= | 74 | +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* |
75 | -set _SKIP=2 | 75 | + |
76 | - | 76 | +:end |
77 | -:win9xME_args_slurp | 77 | +@rem End local scope for the variables with windows NT shell |
78 | -if "x%~1" == "x" goto execute | 78 | +if "%ERRORLEVEL%"=="0" goto mainEnd |
79 | - | 79 | + |
80 | -set CMD_LINE_ARGS=%* | 80 | +:fail |
81 | - | 81 | +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of |
82 | -:execute | 82 | +rem the _cmd.exe /c_ return code! |
83 | -@rem Setup the command line | 83 | +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 |
84 | - | 84 | +exit /b 1 |
85 | -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | 85 | + |
86 | - | 86 | +:mainEnd |
87 | - | 87 | +if "%OS%"=="Windows_NT" endlocal |
88 | -@rem Execute Gradle | 88 | + |
89 | -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% | 89 | +:omega |
90 | - | ||
91 | -:end | ||
92 | -@rem End local scope for the variables with windows NT shell | ||
93 | -if "%ERRORLEVEL%"=="0" goto mainEnd | ||
94 | - | ||
95 | -:fail | ||
96 | -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | ||
97 | -rem the _cmd.exe /c_ return code! | ||
98 | -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 | ||
99 | -exit /b 1 | ||
100 | - | ||
101 | -:mainEnd | ||
102 | -if "%OS%"=="Windows_NT" endlocal | ||
103 | - | ||
104 | -:omega | ... | ... |
... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' | ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' |
2 | 2 | ||
3 | ext { | 3 | ext { |
4 | PUBLISH_GROUP_ID = 'ly.warp' | 4 | PUBLISH_GROUP_ID = 'ly.warp' |
5 | - PUBLISH_VERSION = '4.5.4.6rc74' | 5 | + PUBLISH_VERSION = '4.5.4.6rc75' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ... | ... |
... | @@ -66,23 +66,23 @@ | ... | @@ -66,23 +66,23 @@ |
66 | android:theme="@style/SDKAppTheme" /> | 66 | android:theme="@style/SDKAppTheme" /> |
67 | 67 | ||
68 | <!-- android:screenOrientation="portrait"--> | 68 | <!-- android:screenOrientation="portrait"--> |
69 | - <activity | 69 | +<!-- <activity--> |
70 | - android:name="ly.warp.sdk.activities.TelematicsActivity" | 70 | +<!-- android:name="ly.warp.sdk.activities.TelematicsActivity"--> |
71 | - android:exported="false" | 71 | +<!-- android:exported="false"--> |
72 | - android:configChanges="orientation|screenSize" | 72 | +<!-- android:configChanges="orientation|screenSize"--> |
73 | - android:theme="@style/SDKAppTheme" /> | 73 | +<!-- android:theme="@style/SDKAppTheme" />--> |
74 | - | 74 | + |
75 | - <activity | 75 | +<!-- <activity--> |
76 | - android:name="ly.warp.sdk.activities.TelematicsHistoryActivity" | 76 | +<!-- android:name="ly.warp.sdk.activities.TelematicsHistoryActivity"--> |
77 | - android:exported="false" | 77 | +<!-- android:exported="false"--> |
78 | - android:configChanges="orientation|screenSize" | 78 | +<!-- android:configChanges="orientation|screenSize"--> |
79 | - android:theme="@style/SDKAppTheme" /> | 79 | +<!-- android:theme="@style/SDKAppTheme" />--> |
80 | - | 80 | + |
81 | - <activity | 81 | +<!-- <activity--> |
82 | - android:name="ly.warp.sdk.activities.TelematicsMetricsActivity" | 82 | +<!-- android:name="ly.warp.sdk.activities.TelematicsMetricsActivity"--> |
83 | - android:exported="false" | 83 | +<!-- android:exported="false"--> |
84 | - android:configChanges="orientation|screenSize" | 84 | +<!-- android:configChanges="orientation|screenSize"--> |
85 | - android:theme="@style/SDKAppTheme" /> | 85 | +<!-- android:theme="@style/SDKAppTheme" />--> |
86 | 86 | ||
87 | <activity | 87 | <activity |
88 | android:name="ly.warp.sdk.activities.GiftsForYouActivity" | 88 | android:name="ly.warp.sdk.activities.GiftsForYouActivity" |
... | @@ -189,6 +189,11 @@ | ... | @@ -189,6 +189,11 @@ |
189 | android:permission="android.permission.BIND_JOB_SERVICE" /> | 189 | android:permission="android.permission.BIND_JOB_SERVICE" /> |
190 | 190 | ||
191 | <service | 191 | <service |
192 | + android:name="ly.warp.sdk.services.EventUnifiedCouponsService" | ||
193 | + android:exported="false" | ||
194 | + android:permission="android.permission.BIND_JOB_SERVICE" /> | ||
195 | + | ||
196 | + <service | ||
192 | android:name="ly.warp.sdk.services.EventCampaignCouponService" | 197 | android:name="ly.warp.sdk.services.EventCampaignCouponService" |
193 | android:exported="false" | 198 | android:exported="false" |
194 | android:permission="android.permission.BIND_JOB_SERVICE" /> | 199 | android:permission="android.permission.BIND_JOB_SERVICE" /> | ... | ... |
... | @@ -22,6 +22,7 @@ import ly.warp.sdk.io.models.Campaign; | ... | @@ -22,6 +22,7 @@ import ly.warp.sdk.io.models.Campaign; |
22 | import ly.warp.sdk.io.models.CampaignList; | 22 | import ly.warp.sdk.io.models.CampaignList; |
23 | import ly.warp.sdk.io.models.Consumer; | 23 | import ly.warp.sdk.io.models.Consumer; |
24 | import ly.warp.sdk.io.models.CouponList; | 24 | import ly.warp.sdk.io.models.CouponList; |
25 | +import ly.warp.sdk.io.models.UnifiedCoupon; | ||
25 | import ly.warp.sdk.io.request.WarplyGetCampaignsRequest; | 26 | import ly.warp.sdk.io.request.WarplyGetCampaignsRequest; |
26 | import ly.warp.sdk.utils.managers.WarplyManager; | 27 | import ly.warp.sdk.utils.managers.WarplyManager; |
27 | 28 | ||
... | @@ -52,6 +53,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation | ... | @@ -52,6 +53,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation |
52 | // WarplyManager.getUserCouponsWithCouponsets(new WarplyUserCouponsRequest(), mUserCouponsReceiver); | 53 | // WarplyManager.getUserCouponsWithCouponsets(new WarplyUserCouponsRequest(), mUserCouponsReceiver); |
53 | WarplyManager.getUserCouponsWithCouponsets(mUserCouponsReceiver); | 54 | WarplyManager.getUserCouponsWithCouponsets(mUserCouponsReceiver); |
54 | WarplyManager.getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), mCampaignsCallback); | 55 | WarplyManager.getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), mCampaignsCallback); |
56 | + WarplyManager.getUnifiedCouponsDeals(mUnifiedCallback); | ||
55 | } | 57 | } |
56 | 58 | ||
57 | @Override | 59 | @Override |
... | @@ -130,4 +132,15 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation | ... | @@ -130,4 +132,15 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation |
130 | } | 132 | } |
131 | }; | 133 | }; |
132 | 134 | ||
135 | + private final CallbackReceiver<ArrayList<UnifiedCoupon>> mUnifiedCallback = new CallbackReceiver<ArrayList<UnifiedCoupon>>() { | ||
136 | + @Override | ||
137 | + public void onSuccess(ArrayList<UnifiedCoupon> result) { | ||
138 | + Toast.makeText(BaseFragmentActivity.this, "Unified Coupons Success " + String.valueOf(result.size()), Toast.LENGTH_SHORT).show(); | ||
139 | + } | ||
140 | + | ||
141 | + @Override | ||
142 | + public void onFailure(int errorCode) { | ||
143 | + Toast.makeText(BaseFragmentActivity.this, "Unified Coupons Error", Toast.LENGTH_SHORT).show(); | ||
144 | + } | ||
145 | + }; | ||
133 | } | 146 | } | ... | ... |
... | @@ -169,9 +169,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | ... | @@ -169,9 +169,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie |
169 | mRecyclerCoupons.setNestedScrollingEnabled(false); | 169 | mRecyclerCoupons.setNestedScrollingEnabled(false); |
170 | mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); | 170 | mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); |
171 | 171 | ||
172 | -// initViews(); | 172 | + initViews(); |
173 | 173 | ||
174 | - WarplyManager.getUnifiedCoupons(mUnifiedCallback); | 174 | +// WarplyManager.getUnifiedCoupons(mUnifiedCallback); |
175 | } | 175 | } |
176 | 176 | ||
177 | @Override | 177 | @Override |
... | @@ -356,6 +356,102 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | ... | @@ -356,6 +356,102 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie |
356 | 356 | ||
357 | @Subscribe() | 357 | @Subscribe() |
358 | public void onMessageEvent(WarplyEventBusManager event) { | 358 | public void onMessageEvent(WarplyEventBusManager event) { |
359 | + if (event.getUnifiedCouponsAdded() != null) { | ||
360 | + mUnifiedPressed = false; | ||
361 | + if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) { | ||
362 | + ArrayList<UnifiedCoupon> tempCouponList = new ArrayList<UnifiedCoupon>(); | ||
363 | + tempCouponList.addAll(WarplyManagerHelper.getMarketCouponsList()); | ||
364 | + | ||
365 | + ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>(); | ||
366 | + for (UnifiedCoupon unicpn : tempCouponList) { | ||
367 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); | ||
368 | + Date newDate = new Date(); | ||
369 | + try { | ||
370 | + newDate = simpleDateFormat.parse(unicpn.getCreated()); | ||
371 | + } catch (ParseException e) { | ||
372 | + e.printStackTrace(); | ||
373 | + } | ||
374 | + unicpn.setExpirationDate(newDate); | ||
375 | + unilist.add(unicpn); | ||
376 | + } | ||
377 | + | ||
378 | + Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate())); | ||
379 | + | ||
380 | + runOnUiThread(() -> { | ||
381 | + mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist); | ||
382 | + mRvMarketCoupons.setAdapter(mAdapterMarketCoupons); | ||
383 | + mAdapterMarketCoupons.getPositionClicks() | ||
384 | + .doOnNext(coupon -> { | ||
385 | + if (!mUnifiedPressed) { | ||
386 | + mUnifiedPressed = true; | ||
387 | + WarplyAnalyticsManager.logTrackersEvent(this, "click", ("UnifiedCoupon").concat(":").concat(coupon.getBarcode())); | ||
388 | + Intent intent = new Intent(LoyaltyWallet.this, UnifiedCouponInfoActivity.class); | ||
389 | + intent.putExtra("coupon", (Serializable) coupon); | ||
390 | + intent.putExtra("isFromWallet", true); | ||
391 | + startActivity(intent); | ||
392 | + } | ||
393 | +// startActivityForResult(intent, 1002); | ||
394 | + }) | ||
395 | + .doOnError(error -> { | ||
396 | + }) | ||
397 | + .subscribe(); | ||
398 | + mAdapterMarketCoupons.notifyDataSetChanged(); | ||
399 | + mLlMarketView.setVisibility(View.VISIBLE); | ||
400 | + | ||
401 | + // Third Expandable Banner | ||
402 | + if (tempCouponList != null && tempCouponList.size() > 0) { | ||
403 | + countValue = 0.0f; | ||
404 | + | ||
405 | + if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) { | ||
406 | + if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) { | ||
407 | + for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) { | ||
408 | + for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) { | ||
409 | + if (cou.getCouponsetUuid().equals(couset.getUuid())) { | ||
410 | + countValue += Float.valueOf(cou.getDiscount()); | ||
411 | + cou.setDescription(couset.getShortDescription()); | ||
412 | + cou.setImage(couset.getImgPreview()); | ||
413 | + cou.setName(couset.getName()); | ||
414 | + cou.setMerchantUuid(couset.getMerchantUuid()); | ||
415 | + cou.setInnerText(couset.getInnerText()); | ||
416 | + cou.setDiscount_type(couset.getDiscount_type()); | ||
417 | + cou.setFinal_price(couset.getFinal_price()); | ||
418 | + break; | ||
419 | + } | ||
420 | + } | ||
421 | + } | ||
422 | + } | ||
423 | + } | ||
424 | + | ||
425 | + mFavValue += countValue; | ||
426 | + String badgeValue = String.format("%.02f", countValue); | ||
427 | + mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue)); | ||
428 | + if (String.valueOf(countValue).length() >= 3) { | ||
429 | + mTvMarketValue.setTextSize(12); | ||
430 | + } else { | ||
431 | + mTvMarketValue.setTextSize(14); | ||
432 | + } | ||
433 | + SpannableStringBuilder sBuilderThird = new SpannableStringBuilder(); | ||
434 | + sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue)); | ||
435 | + CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | ||
436 | + sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | ||
437 | + mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE); | ||
438 | + } else { | ||
439 | + String badgeValue = String.format("%.02f", 0.0f); | ||
440 | + mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue)); | ||
441 | + SpannableStringBuilder sBuilderThird = new SpannableStringBuilder(); | ||
442 | + sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue)); | ||
443 | + CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | ||
444 | + sBuilderThird.setSpan(typefaceBoldSpanThird, 15, 16 + badgeValue.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | ||
445 | + mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE); | ||
446 | + } | ||
447 | + }); | ||
448 | + } else { | ||
449 | + runOnUiThread(() -> { | ||
450 | + mLlMarketView.setVisibility(View.GONE); | ||
451 | + }); | ||
452 | + } | ||
453 | + return; | ||
454 | + } | ||
359 | if (event.getCouponsAdded() != null) { | 455 | if (event.getCouponsAdded() != null) { |
360 | mCouponPressed = false; | 456 | mCouponPressed = false; |
361 | CouponList tempCouponList = new CouponList(); | 457 | CouponList tempCouponList = new CouponList(); |
... | @@ -398,6 +494,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | ... | @@ -398,6 +494,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie |
398 | }) | 494 | }) |
399 | .subscribe(); | 495 | .subscribe(); |
400 | mAdapterCoupons.notifyDataSetChanged(); | 496 | mAdapterCoupons.notifyDataSetChanged(); |
497 | +// mLlGifts.setVisibility(View.VISIBLE); | ||
401 | } else { | 498 | } else { |
402 | mLlGifts.setVisibility(View.GONE); | 499 | mLlGifts.setVisibility(View.GONE); |
403 | } | 500 | } |
... | @@ -419,9 +516,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | ... | @@ -419,9 +516,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie |
419 | nonTelcoDialog(); | 516 | nonTelcoDialog(); |
420 | } | 517 | } |
421 | 518 | ||
422 | - if (mUnifiedCoupons != null && mUnifiedCoupons.size() > 0) { | 519 | + if (WarplyManagerHelper.getMarketCouponsList() != null && WarplyManagerHelper.getMarketCouponsList().size() > 0) { |
423 | ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>(); | 520 | ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>(); |
424 | - for (UnifiedCoupon unicpn : mUnifiedCoupons) { | 521 | + for (UnifiedCoupon unicpn : WarplyManagerHelper.getMarketCouponsList()) { |
425 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); | 522 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); |
426 | Date newDate = new Date(); | 523 | Date newDate = new Date(); |
427 | try { | 524 | try { | ... | ... |
... | @@ -12,6 +12,7 @@ import android.widget.LinearLayout; | ... | @@ -12,6 +12,7 @@ import android.widget.LinearLayout; |
12 | import android.widget.TextView; | 12 | import android.widget.TextView; |
13 | 13 | ||
14 | import androidx.core.content.ContextCompat; | 14 | import androidx.core.content.ContextCompat; |
15 | +import androidx.core.text.HtmlCompat; | ||
15 | import androidx.recyclerview.widget.LinearLayoutManager; | 16 | import androidx.recyclerview.widget.LinearLayoutManager; |
16 | import androidx.recyclerview.widget.RecyclerView; | 17 | import androidx.recyclerview.widget.RecyclerView; |
17 | 18 | ||
... | @@ -49,7 +50,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | ... | @@ -49,7 +50,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL |
49 | 50 | ||
50 | private ImageView mIvBack, mIvBarcode, mIvMarketExpand; | 51 | private ImageView mIvBack, mIvBarcode, mIvMarketExpand; |
51 | private TextView mTvTerms, mTvCouponCode, mTvCouponDate, mTvMarketExpand, | 52 | private TextView mTvTerms, mTvCouponCode, mTvCouponDate, mTvMarketExpand, |
52 | - mTvTermsValue, mTvFullBarcode; | 53 | + mTvTermsValue, mTvFullBarcode, mTvActiveValue; |
53 | private LinearLayout mLlShops, mLlBarcodeContainer, mLlTerms, mLlMarketCoupons, mLlMarketExpand; | 54 | private LinearLayout mLlShops, mLlBarcodeContainer, mLlTerms, mLlMarketCoupons, mLlMarketExpand; |
54 | private UnifiedCoupon mCoupon; | 55 | private UnifiedCoupon mCoupon; |
55 | private boolean mIsBarcodeShown = false, mIsTermsShown = false, mIsFromWallet = false, | 56 | private boolean mIsBarcodeShown = false, mIsTermsShown = false, mIsFromWallet = false, |
... | @@ -92,6 +93,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | ... | @@ -92,6 +93,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL |
92 | mTvMarketExpand = findViewById(R.id.tv_market_expand); | 93 | mTvMarketExpand = findViewById(R.id.tv_market_expand); |
93 | mIvMarketExpand = findViewById(R.id.iv_market_expand); | 94 | mIvMarketExpand = findViewById(R.id.iv_market_expand); |
94 | mRecyclerCoupons = findViewById(R.id.rv_active_market_coupons); | 95 | mRecyclerCoupons = findViewById(R.id.rv_active_market_coupons); |
96 | + mTvActiveValue = findViewById(R.id.textView14); | ||
95 | mRecyclerCoupons.setNestedScrollingEnabled(false); | 97 | mRecyclerCoupons.setNestedScrollingEnabled(false); |
96 | mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); | 98 | mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); |
97 | 99 | ||
... | @@ -174,8 +176,12 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | ... | @@ -174,8 +176,12 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL |
174 | mIsMarketExpand = false; | 176 | mIsMarketExpand = false; |
175 | 177 | ||
176 | if (mCoupon.getCoupons() != null && mCoupon.getCoupons().size() > 0) { | 178 | if (mCoupon.getCoupons() != null && mCoupon.getCoupons().size() > 0) { |
179 | + float activeValue = 0.0f; | ||
177 | CouponList cpnlist = new CouponList(); | 180 | CouponList cpnlist = new CouponList(); |
178 | for (Coupon cpn : mCoupon.getCoupons()) { | 181 | for (Coupon cpn : mCoupon.getCoupons()) { |
182 | + if (cpn.getStatus() == 1) { | ||
183 | + activeValue += Float.parseFloat(cpn.getDiscount()); | ||
184 | + } | ||
179 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | 185 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); |
180 | Date newDate = new Date(); | 186 | Date newDate = new Date(); |
181 | try { | 187 | try { |
... | @@ -187,6 +193,8 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL | ... | @@ -187,6 +193,8 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL |
187 | cpnlist.add(cpn); | 193 | cpnlist.add(cpn); |
188 | } | 194 | } |
189 | 195 | ||
196 | + mTvActiveValue.setText(HtmlCompat.fromHtml(String.format(getString(R.string.cos_unified_subtitle), String.valueOf(activeValue)), HtmlCompat.FROM_HTML_MODE_COMPACT)); | ||
197 | + | ||
190 | Collections.sort(cpnlist, (coupon1, coupon2) -> coupon1.getExpirationDate().compareTo(coupon2.getExpirationDate())); | 198 | Collections.sort(cpnlist, (coupon1, coupon2) -> coupon1.getExpirationDate().compareTo(coupon2.getExpirationDate())); |
191 | for (Coupon tempItem : cpnlist) { | 199 | for (Coupon tempItem : cpnlist) { |
192 | if (tempItem.getStatus() == 1) { | 200 | if (tempItem.getStatus() == 1) { | ... | ... |
1 | +/* | ||
2 | + * Copyright 2010-2013 Warply Ltd. All rights reserved. | ||
3 | + * | ||
4 | + * Redistribution and use in source and binary forms, without modification, are | ||
5 | + * permitted provided that the following conditions are met: | ||
6 | + * | ||
7 | + * 1. Redistributions of source code must retain the above copyright notice, | ||
8 | + * this list of conditions and the following disclaimer. | ||
9 | + * | ||
10 | + * 2. Redistributions in binary form must reproduce the above copyright notice, | ||
11 | + * this list of conditions and the following disclaimer in the documentation | ||
12 | + * and/or other materials provided with the distribution. | ||
13 | + * | ||
14 | + * THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR | ||
15 | + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
16 | + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | ||
17 | + * EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
18 | + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
19 | + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, | ||
20 | + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
21 | + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
22 | + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, | ||
23 | + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
24 | + */ | ||
25 | + | ||
26 | +package ly.warp.sdk.io.models; | ||
27 | + | ||
28 | + | ||
29 | +/** | ||
30 | + * Created by Panagiotis Triantafyllou on 18-Sept-23. | ||
31 | + */ | ||
32 | + | ||
33 | +public class UnifiedCouponsEventModel { | ||
34 | + private boolean success; | ||
35 | + | ||
36 | + public UnifiedCouponsEventModel() { | ||
37 | + this.success = true; | ||
38 | + } | ||
39 | + | ||
40 | + public boolean isSuccess() { | ||
41 | + return success; | ||
42 | + } | ||
43 | + | ||
44 | + public void setSuccess(boolean success) { | ||
45 | + this.success = success; | ||
46 | + } | ||
47 | +} |
1 | +package ly.warp.sdk.services; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | + | ||
5 | +import androidx.annotation.NonNull; | ||
6 | +import androidx.work.Worker; | ||
7 | +import androidx.work.WorkerParameters; | ||
8 | + | ||
9 | +import org.greenrobot.eventbus.EventBus; | ||
10 | + | ||
11 | +import ly.warp.sdk.io.models.UnifiedCouponsEventModel; | ||
12 | +import ly.warp.sdk.utils.managers.WarplyEventBusManager; | ||
13 | + | ||
14 | +/** | ||
15 | + * Created by Panagiotis Triantafyllou on 18/Sept/2023. | ||
16 | + */ | ||
17 | +public class EventUnifiedCouponsService extends Worker { | ||
18 | + | ||
19 | + public EventUnifiedCouponsService(@NonNull Context context, @NonNull WorkerParameters workerParams) { | ||
20 | + super(context, workerParams); | ||
21 | + } | ||
22 | + | ||
23 | + @NonNull | ||
24 | + @Override | ||
25 | + public Result doWork() { | ||
26 | + UnifiedCouponsEventModel couponsAdded = new UnifiedCouponsEventModel(); | ||
27 | + EventBus.getDefault().post(new WarplyEventBusManager(couponsAdded)); | ||
28 | + | ||
29 | + return Result.success(); | ||
30 | + } | ||
31 | +} |
... | @@ -127,12 +127,13 @@ public class WarplyManagerHelper { | ... | @@ -127,12 +127,13 @@ public class WarplyManagerHelper { |
127 | mAlertDialogRejectSharing, mAlertDialogReturnSharing, mAlertDialogErrorSharing, | 127 | mAlertDialogRejectSharing, mAlertDialogReturnSharing, mAlertDialogErrorSharing, |
128 | mAlertDialogErrorUsedSharing, mAlertDialogErrorExpiredSharing, mAlertDialogNoInternet; | 128 | mAlertDialogErrorUsedSharing, mAlertDialogErrorExpiredSharing, mAlertDialogNoInternet; |
129 | private static LoyaltyBadgeModel mLoyaltyBadge = new LoyaltyBadgeModel(); | 129 | private static LoyaltyBadgeModel mLoyaltyBadge = new LoyaltyBadgeModel(); |
130 | - private static float mDealsSum = 0.0f; | 130 | + private static float mDealsSum = 0.0f, mUnifiedDiscount = 0.0f; |
131 | private static MerchantList mMerchantList = new MerchantList(); | 131 | private static MerchantList mMerchantList = new MerchantList(); |
132 | public static double mMetersWebview = 0.0d; | 132 | public static double mMetersWebview = 0.0d; |
133 | public static int mStepsWebview = 0; | 133 | public static int mStepsWebview = 0; |
134 | public static int mSteps = 0; | 134 | public static int mSteps = 0; |
135 | - private static ArrayList<UnifiedCoupon> mMarketCoupons = new ArrayList<>(); | 135 | + private static ArrayList<UnifiedCoupon> mMarketCoupons = new ArrayList<>(), |
136 | + mMarketCouponsList = new ArrayList<>(); | ||
136 | 137 | ||
137 | // =========================================================== | 138 | // =========================================================== |
138 | // Methods for/from SuperClass/Interfaces | 139 | // Methods for/from SuperClass/Interfaces |
... | @@ -1336,6 +1337,22 @@ public class WarplyManagerHelper { | ... | @@ -1336,6 +1337,22 @@ public class WarplyManagerHelper { |
1336 | mMarketCoupons = marketCoupons; | 1337 | mMarketCoupons = marketCoupons; |
1337 | } | 1338 | } |
1338 | 1339 | ||
1340 | + public static ArrayList<UnifiedCoupon> getMarketCouponsList() { | ||
1341 | + return mMarketCouponsList; | ||
1342 | + } | ||
1343 | + | ||
1344 | + public static void setMarketCouponsList(ArrayList<UnifiedCoupon> marketCoupons) { | ||
1345 | + mMarketCouponsList = marketCoupons; | ||
1346 | + } | ||
1347 | + | ||
1348 | + public static void setUnifiedCouponsDiscount(float unifiedDiscount) { | ||
1349 | + mUnifiedDiscount = unifiedDiscount; | ||
1350 | + } | ||
1351 | + | ||
1352 | + public static float getUnifiedCouponsDiscount() { | ||
1353 | + return mUnifiedDiscount; | ||
1354 | + } | ||
1355 | + | ||
1339 | public static boolean checkForLoyaltySDKNotification(Context context, Map<String, String> pushPayload) { | 1356 | public static boolean checkForLoyaltySDKNotification(Context context, Map<String, String> pushPayload) { |
1340 | Bundle data = convertToBundle(pushPayload); | 1357 | Bundle data = convertToBundle(pushPayload); |
1341 | if (data == null || !data.containsKey("loyalty-action")) | 1358 | if (data == null || !data.containsKey("loyalty-action")) | ... | ... |
... | @@ -14,6 +14,7 @@ import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel; | ... | @@ -14,6 +14,7 @@ import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel; |
14 | import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; | 14 | import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; |
15 | import ly.warp.sdk.io.models.LoyaltySDKSessionExpiredEventModel; | 15 | import ly.warp.sdk.io.models.LoyaltySDKSessionExpiredEventModel; |
16 | import ly.warp.sdk.io.models.QuestionnaireEventModel; | 16 | import ly.warp.sdk.io.models.QuestionnaireEventModel; |
17 | +import ly.warp.sdk.io.models.UnifiedCouponsEventModel; | ||
17 | import ly.warp.sdk.io.models.WarplyCCMSEnabledModel; | 18 | import ly.warp.sdk.io.models.WarplyCCMSEnabledModel; |
18 | import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel; | 19 | import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel; |
19 | import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel; | 20 | import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel; |
... | @@ -43,6 +44,8 @@ public class WarplyEventBusManager { | ... | @@ -43,6 +44,8 @@ public class WarplyEventBusManager { |
43 | private ActiveDFYCouponEventModel activeCoupon; | 44 | private ActiveDFYCouponEventModel activeCoupon; |
44 | private ContexualEventModel ccmsAdded; | 45 | private ContexualEventModel ccmsAdded; |
45 | private CouponsEventModel couponsAdded; | 46 | private CouponsEventModel couponsAdded; |
47 | + | ||
48 | + private UnifiedCouponsEventModel unifiedCouponsAdded; | ||
46 | private LoyaltyEventModel campaignsAdded; | 49 | private LoyaltyEventModel campaignsAdded; |
47 | private HealthEventModel healthAdded; | 50 | private HealthEventModel healthAdded; |
48 | private WarplyCouponsChangedEventModel couponsChanged; | 51 | private WarplyCouponsChangedEventModel couponsChanged; |
... | @@ -89,6 +92,10 @@ public class WarplyEventBusManager { | ... | @@ -89,6 +92,10 @@ public class WarplyEventBusManager { |
89 | this.couponsAdded = couponsAdded; | 92 | this.couponsAdded = couponsAdded; |
90 | } | 93 | } |
91 | 94 | ||
95 | + public WarplyEventBusManager(UnifiedCouponsEventModel unifiedCouponsAdded) { | ||
96 | + this.unifiedCouponsAdded = unifiedCouponsAdded; | ||
97 | + } | ||
98 | + | ||
92 | public WarplyEventBusManager(WarplyPacingCardEventModel widgetChanged) { | 99 | public WarplyEventBusManager(WarplyPacingCardEventModel widgetChanged) { |
93 | this.widgetChanged = widgetChanged; | 100 | this.widgetChanged = widgetChanged; |
94 | } | 101 | } |
... | @@ -227,6 +234,10 @@ public class WarplyEventBusManager { | ... | @@ -227,6 +234,10 @@ public class WarplyEventBusManager { |
227 | return couponsAdded; | 234 | return couponsAdded; |
228 | } | 235 | } |
229 | 236 | ||
237 | + public UnifiedCouponsEventModel getUnifiedCouponsAdded() { | ||
238 | + return unifiedCouponsAdded; | ||
239 | + } | ||
240 | + | ||
230 | public LoyaltyEventModel getCampaignsAdded() { | 241 | public LoyaltyEventModel getCampaignsAdded() { |
231 | return campaignsAdded; | 242 | return campaignsAdded; |
232 | } | 243 | } | ... | ... |
... | @@ -150,6 +150,8 @@ import ly.warp.sdk.io.request.WarplyVerifyTicketRequest; | ... | @@ -150,6 +150,8 @@ import ly.warp.sdk.io.request.WarplyVerifyTicketRequest; |
150 | import ly.warp.sdk.io.volley.ApiClient; | 150 | import ly.warp.sdk.io.volley.ApiClient; |
151 | import ly.warp.sdk.io.volley.ApiService; | 151 | import ly.warp.sdk.io.volley.ApiService; |
152 | import ly.warp.sdk.services.EventCampaignService; | 152 | import ly.warp.sdk.services.EventCampaignService; |
153 | +import ly.warp.sdk.services.EventCouponsService; | ||
154 | +import ly.warp.sdk.services.EventUnifiedCouponsService; | ||
153 | import ly.warp.sdk.services.WarplyHealthService; | 155 | import ly.warp.sdk.services.WarplyHealthService; |
154 | import ly.warp.sdk.utils.WarpJSONParser; | 156 | import ly.warp.sdk.utils.WarpJSONParser; |
155 | import ly.warp.sdk.utils.WarpUtils; | 157 | import ly.warp.sdk.utils.WarpUtils; |
... | @@ -1968,6 +1970,7 @@ public class WarplyManager { | ... | @@ -1968,6 +1970,7 @@ public class WarplyManager { |
1968 | } | 1970 | } |
1969 | 1971 | ||
1970 | WarplyManagerHelper.setMarketCoupons(allCouponList); | 1972 | WarplyManagerHelper.setMarketCoupons(allCouponList); |
1973 | + WarplyManagerHelper.setMarketCouponsList(couponList); | ||
1971 | } | 1974 | } |
1972 | } | 1975 | } |
1973 | } catch (Exception e) { | 1976 | } catch (Exception e) { |
... | @@ -2024,6 +2027,164 @@ public class WarplyManager { | ... | @@ -2024,6 +2027,164 @@ public class WarplyManager { |
2024 | }); | 2027 | }); |
2025 | } | 2028 | } |
2026 | 2029 | ||
2030 | + public static void getUnifiedCouponsDeals(final CallbackReceiver<ArrayList<UnifiedCoupon>> receiver) { | ||
2031 | + WarpUtils.log("************* WARPLY User Coupons Request ********************"); | ||
2032 | + WarpUtils.log("[WARP Trace] WARPLY User Coupons Request is active"); | ||
2033 | + WarpUtils.log("**************************************************"); | ||
2034 | + ApiService service = ApiClient.getRetrofitInstance().create(ApiService.class); | ||
2035 | + getCouponsetsRetro(service, true, new Callback<ResponseBody>() { | ||
2036 | + @Override | ||
2037 | + public void onResponse(Call<ResponseBody> call, Response<ResponseBody> responseCouponsets) { | ||
2038 | + if (responseCouponsets.code() == 200 && responseCouponsets.body() != null) { | ||
2039 | + JSONObject jobjCouponsetsResponse = null; | ||
2040 | + try { | ||
2041 | + jobjCouponsetsResponse = new JSONObject(responseCouponsets.body().string()); | ||
2042 | + } catch (Exception e) { | ||
2043 | + e.printStackTrace(); | ||
2044 | + } | ||
2045 | + | ||
2046 | + if (jobjCouponsetsResponse != null && jobjCouponsetsResponse.has("status") && jobjCouponsetsResponse.optString("status", "2").equals("1")) { | ||
2047 | + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); | ||
2048 | + dynatraceEvent.setEventName("custom_success_couponsets_sm_loyalty"); | ||
2049 | + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent)); | ||
2050 | + | ||
2051 | + JSONObject finalJobjCouponsetsResponse = jobjCouponsetsResponse; | ||
2052 | + // COUPONSETS START // | ||
2053 | + JSONArray jCouponsetsBody = null; | ||
2054 | + try { | ||
2055 | + jCouponsetsBody = finalJobjCouponsetsResponse.optJSONArray("result"); | ||
2056 | + } catch (Exception e) { | ||
2057 | + e.printStackTrace(); | ||
2058 | + } | ||
2059 | + // COUPONSETS END // | ||
2060 | + | ||
2061 | + if (jCouponsetsBody != null) { | ||
2062 | + CouponsetsList mCouponsetList = new CouponsetsList(); | ||
2063 | + for (int i = 0; i < jCouponsetsBody.length(); ++i) { | ||
2064 | + Couponset tempCouponset = new Couponset(jCouponsetsBody.optJSONObject(i)); | ||
2065 | + mCouponsetList.add(tempCouponset); | ||
2066 | + } | ||
2067 | + WarplyManagerHelper.setCouponsetsDeals(mCouponsetList); | ||
2068 | + | ||
2069 | + getUnifiedCouponsRetro(service, new Callback<ResponseBody>() { | ||
2070 | + @Override | ||
2071 | + public void onResponse(@NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> responseCoupons) { | ||
2072 | + if (responseCoupons.code() == 200 && responseCoupons.body() != null) { | ||
2073 | + JSONObject jobjCouponsResponse = null; | ||
2074 | + try { | ||
2075 | + jobjCouponsResponse = new JSONObject(responseCoupons.body().string()); | ||
2076 | + } catch (Exception e) { | ||
2077 | + e.printStackTrace(); | ||
2078 | + } | ||
2079 | + if (jobjCouponsResponse != null && jobjCouponsResponse.has("status") && jobjCouponsResponse.optInt("status", 2) == 1) { | ||
2080 | + ArrayList<UnifiedCoupon> couponList = new ArrayList<UnifiedCoupon>(); | ||
2081 | + ArrayList<UnifiedCoupon> allCouponList = new ArrayList<UnifiedCoupon>(); | ||
2082 | + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); | ||
2083 | + dynatraceEvent.setEventName("custom_success_unified_coupons_loyalty"); | ||
2084 | + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent)); | ||
2085 | + JSONObject finalJobjCouponsResponse = jobjCouponsResponse; | ||
2086 | + final ExecutorService executor = Executors.newFixedThreadPool(1); | ||
2087 | + executor.submit(() -> { | ||
2088 | + JSONObject jCouponsBody = null; | ||
2089 | + try { | ||
2090 | + jCouponsBody = finalJobjCouponsResponse.optJSONObject("result"); | ||
2091 | + if (jCouponsBody != null && jCouponsBody.length() > 0) { | ||
2092 | + JSONArray jCouponsInnerBody = null; | ||
2093 | + jCouponsInnerBody = jCouponsBody.optJSONArray("coupons"); | ||
2094 | + if (jCouponsInnerBody != null && jCouponsInnerBody.length() > 0) { | ||
2095 | + for (int i = 0; i < jCouponsInnerBody.length(); i++) { | ||
2096 | + UnifiedCoupon tempUni = new UnifiedCoupon(jCouponsInnerBody.optJSONObject(i)); | ||
2097 | + allCouponList.add(tempUni); | ||
2098 | + if (tempUni.getStatus().trim().equals("active")) | ||
2099 | + couponList.add(tempUni); | ||
2100 | + } | ||
2101 | + | ||
2102 | + WarplyManagerHelper.setMarketCoupons(allCouponList); | ||
2103 | + WarplyManagerHelper.setMarketCouponsList(couponList); | ||
2104 | + } | ||
2105 | + } | ||
2106 | + } catch (Exception e) { | ||
2107 | + e.printStackTrace(); | ||
2108 | + } | ||
2109 | + | ||
2110 | +// if (allCouponList != null && allCouponList.size() > 0) { | ||
2111 | +// float countValue = 0.0f; | ||
2112 | +// if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) { | ||
2113 | +// if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) { | ||
2114 | +// for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) { | ||
2115 | +// for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) { | ||
2116 | +// if (cou.getCouponsetUuid().equals(couset.getUuid())) { | ||
2117 | +// countValue += Float.parseFloat(cou.getDiscount()); | ||
2118 | +// cou.setDescription(couset.getShortDescription()); | ||
2119 | +// cou.setImage(couset.getImgPreview()); | ||
2120 | +// cou.setName(couset.getName()); | ||
2121 | +// cou.setMerchantUuid(couset.getMerchantUuid()); | ||
2122 | +// cou.setInnerText(couset.getInnerText()); | ||
2123 | +// cou.setDiscount_type(couset.getDiscount_type()); | ||
2124 | +// cou.setFinal_price(couset.getFinal_price()); | ||
2125 | +// break; | ||
2126 | +// } | ||
2127 | +// } | ||
2128 | +// } | ||
2129 | +// } | ||
2130 | +// } | ||
2131 | +// | ||
2132 | +// WarplyManagerHelper.setUnifiedCouponsDiscount(countValue); | ||
2133 | +// } | ||
2134 | + | ||
2135 | + OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventUnifiedCouponsService.class).build(); | ||
2136 | + WorkManager.getInstance(Warply.getWarplyContext()).enqueue(mywork); | ||
2137 | + new Handler(Looper.getMainLooper()).post(() -> receiver.onSuccess(couponList)); | ||
2138 | + executor.shutdownNow(); | ||
2139 | + }); | ||
2140 | + } else { | ||
2141 | + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); | ||
2142 | + dynatraceEvent.setEventName("custom_error_unified_coupons_loyalty"); | ||
2143 | + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent)); | ||
2144 | + receiver.onFailure(2); | ||
2145 | + } | ||
2146 | + } else { | ||
2147 | + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); | ||
2148 | + dynatraceEvent.setEventName("custom_error_unified_coupons_loyalty"); | ||
2149 | + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent)); | ||
2150 | + receiver.onFailure(responseCoupons.code()); | ||
2151 | + } | ||
2152 | + } | ||
2153 | + | ||
2154 | + @Override | ||
2155 | + public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) { | ||
2156 | + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); | ||
2157 | + dynatraceEvent.setEventName("custom_error_user_coupons_loyalty"); | ||
2158 | + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent)); | ||
2159 | + receiver.onFailure(2); | ||
2160 | + } | ||
2161 | + }); | ||
2162 | + } | ||
2163 | + } else { | ||
2164 | + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); | ||
2165 | + dynatraceEvent.setEventName("custom_error_couponsets_sm_loyalty"); | ||
2166 | + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent)); | ||
2167 | + receiver.onFailure(2); | ||
2168 | + } | ||
2169 | + | ||
2170 | + } else { | ||
2171 | + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); | ||
2172 | + dynatraceEvent.setEventName("custom_error_couponsets_sm_loyalty"); | ||
2173 | + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent)); | ||
2174 | + receiver.onFailure(responseCouponsets.code()); | ||
2175 | + } | ||
2176 | + } | ||
2177 | + | ||
2178 | + @Override | ||
2179 | + public void onFailure(Call<ResponseBody> call, Throwable t) { | ||
2180 | + LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel(); | ||
2181 | + dynatraceEvent.setEventName("custom_error_couponsets_sm_loyalty"); | ||
2182 | + EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent)); | ||
2183 | + receiver.onFailure(2); | ||
2184 | + } | ||
2185 | + }); | ||
2186 | + } | ||
2187 | + | ||
2027 | public static void sendAccelerationDataToServer(JSONArray telematicsData, final CallbackReceiver<Integer> receiver) { | 2188 | public static void sendAccelerationDataToServer(JSONArray telematicsData, final CallbackReceiver<Integer> receiver) { |
2028 | WarpUtils.log("************* WARPLY User Telematics Request ********************"); | 2189 | WarpUtils.log("************* WARPLY User Telematics Request ********************"); |
2029 | WarpUtils.log("[WARP Trace] WARPLY User Telematics Request is active"); | 2190 | WarpUtils.log("[WARP Trace] WARPLY User Telematics Request is active"); | ... | ... |
... | @@ -90,11 +90,13 @@ public class MarketCouponAdapter extends RecyclerView.Adapter<MarketCouponAdapte | ... | @@ -90,11 +90,13 @@ public class MarketCouponAdapter extends RecyclerView.Adapter<MarketCouponAdapte |
90 | 90 | ||
91 | if (couponItem != null) { | 91 | if (couponItem != null) { |
92 | int count = 0; | 92 | int count = 0; |
93 | + float activeValue = 0.0f; | ||
93 | if (couponItem.getCoupons() != null && couponItem.getCoupons().size() > 0) { | 94 | if (couponItem.getCoupons() != null && couponItem.getCoupons().size() > 0) { |
94 | ArrayList<Coupon> couponList = new ArrayList<Coupon>(); | 95 | ArrayList<Coupon> couponList = new ArrayList<Coupon>(); |
95 | for (Coupon item : couponItem.getCoupons()) { | 96 | for (Coupon item : couponItem.getCoupons()) { |
96 | if (item.getStatus() == 1) { | 97 | if (item.getStatus() == 1) { |
97 | count++; | 98 | count++; |
99 | + activeValue += Float.parseFloat(item.getDiscount()); | ||
98 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); | 100 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); |
99 | Date newDate = new Date(); | 101 | Date newDate = new Date(); |
100 | try { | 102 | try { |
... | @@ -123,9 +125,9 @@ public class MarketCouponAdapter extends RecyclerView.Adapter<MarketCouponAdapte | ... | @@ -123,9 +125,9 @@ public class MarketCouponAdapter extends RecyclerView.Adapter<MarketCouponAdapte |
123 | } | 125 | } |
124 | 126 | ||
125 | if (count > 1) { | 127 | if (count > 1) { |
126 | - holder.tvCouponCount.setText(String.format(mContext.getString(R.string.cos_market_active_coupons), String.valueOf(count))); | 128 | + holder.tvCouponCount.setText(String.format(mContext.getString(R.string.cos_market_active_coupons), String.valueOf(count), String.valueOf(activeValue))); |
127 | } else if (count == 1) { | 129 | } else if (count == 1) { |
128 | - holder.tvCouponCount.setText(String.format(mContext.getString(R.string.cos_market_active_coupons_single), String.valueOf(count))); | 130 | + holder.tvCouponCount.setText(String.format(mContext.getString(R.string.cos_market_active_coupons_single), String.valueOf(count), String.valueOf(activeValue))); |
129 | } | 131 | } |
130 | 132 | ||
131 | 133 | ... | ... |
... | @@ -90,7 +90,7 @@ | ... | @@ -90,7 +90,7 @@ |
90 | android:layout_height="wrap_content" | 90 | android:layout_height="wrap_content" |
91 | android:layout_marginStart="8dp" | 91 | android:layout_marginStart="8dp" |
92 | android:layout_marginEnd="16dp" | 92 | android:layout_marginEnd="16dp" |
93 | - android:maxLines="3" | 93 | + android:maxLines="4" |
94 | android:ellipsize="end" | 94 | android:ellipsize="end" |
95 | android:textColor="@color/cos_light_black" | 95 | android:textColor="@color/cos_light_black" |
96 | android:textSize="12sp" | 96 | android:textSize="12sp" | ... | ... |
... | @@ -153,14 +153,14 @@ | ... | @@ -153,14 +153,14 @@ |
153 | <string name="cos_profile_preferences_placeholder">Οι προτιμήσεις μου</string> | 153 | <string name="cos_profile_preferences_placeholder">Οι προτιμήσεις μου</string> |
154 | <string name="cos_market_title">SUPERMARKET DEALS</string> | 154 | <string name="cos_market_title">SUPERMARKET DEALS</string> |
155 | <string name="cos_rewards_title2">COSMOTE Επιβράβευση</string> | 155 | <string name="cos_rewards_title2">COSMOTE Επιβράβευση</string> |
156 | - <string name="cos_market_item_title">COSMOTE\nSuperMarket\nDeals</string> | 156 | + <string name="cos_market_item_title">COSMOTE\nSUPERMARKET\nDEALS</string> |
157 | - <string name="cos_market_active_coupons">έχεις %1$s ενεργά κουπόνια</string> | 157 | + <string name="cos_market_active_coupons">έχεις %1$s ενεργά κουπόνια αξίας %2$s€</string> |
158 | - <string name="cos_market_active_coupons_single">έχεις %1$s ενεργό κουπόνι</string> | 158 | + <string name="cos_market_active_coupons_single">έχεις %1$s ενεργό κουπόνι αξίας %2$s€</string> |
159 | <string name="cos_unified_title">Εκπτωτικό κουπόνι COSMOTE SuperMarket Deals!</string> | 159 | <string name="cos_unified_title">Εκπτωτικό κουπόνι COSMOTE SuperMarket Deals!</string> |
160 | - <string name="cos_unified_subtitle">Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών.</string> | 160 | + <string name="cos_unified_subtitle">Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών αξίας <![CDATA[<b>%1$s€</b>]]>.</string> |
161 | <string name="cos_markets">Δες τα supermarket</string> | 161 | <string name="cos_markets">Δες τα supermarket</string> |
162 | - <string name="cos_show_market_coupons">Εμφάνιση κουπονιών</string> | 162 | + <string name="cos_show_market_coupons">Εμφάνιση προσφορών</string> |
163 | - <string name="cos_hide_market_coupons">Απόκρυψη κουπονιών</string> | 163 | + <string name="cos_hide_market_coupons">Απόκρυψη προσφορών</string> |
164 | <string name="cos_market_terms">1. Το εκπτωτικό κουπόνι ισχύει έως την ημερομηνία που αναφέρεται παραπάνω.\n | 164 | <string name="cos_market_terms">1. Το εκπτωτικό κουπόνι ισχύει έως την ημερομηνία που αναφέρεται παραπάνω.\n |
165 | 2. To εκπτωτικό κουπόνι αφορά στα ενεργά κουπόνια προσφορών όπως αναφέρονται παραπάνω.\n | 165 | 2. To εκπτωτικό κουπόνι αφορά στα ενεργά κουπόνια προσφορών όπως αναφέρονται παραπάνω.\n |
166 | 3. Το εκπτωτικό κουπόνι μπορεί να χρησιμοποιηθεί σε μια μόνο συναλλαγή.\n | 166 | 3. Το εκπτωτικό κουπόνι μπορεί να χρησιμοποιηθεί σε μια μόνο συναλλαγή.\n | ... | ... |
-
Please register or login to post a comment