Panagiotis Triantafyllou

sm deals changes

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();
......
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
......
This diff is collapsed. Click to expand it.
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 }
......
...@@ -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
......