Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2023-07-25 18:28:04 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
109ecee4a7b921e995c0150edad70cf089256bb3
109ecee4
1 parent
57215601
feedback fixes
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
9 deletions
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyMarketAnalysisActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/ApiService.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
View file @
109ecee
...
...
@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public
void
onWarplyReady
()
{
if
(!
WarplyDBHelper
.
getInstance
(
SplashActivity
.
this
).
isTableNotEmpty
(
"auth"
))
{
WarplyManager
.
getCosmoteUser
(
new
WarplyCosmoteUserRequest
()
.
setGuid
(
"
6005892749
"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
.
setGuid
(
"
7000070282
"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
mLoginReceiver
);
}
else
{
startNextActivity
();
...
...
warply_android_sdk/build.gradle
View file @
109ecee
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4.6rc7
0
'
PUBLISH_VERSION
=
'4.5.4.6rc7
1
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyMarketAnalysisActivity.java
View file @
109ecee
...
...
@@ -280,9 +280,9 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl
@Override
public
void
onSuccess
(
SharingList
result
)
{
if
(
result
!=
null
&&
result
.
size
()
>
0
)
{
if
(
WarplyManagerHelper
.
getCouponsets
()
!=
null
&&
WarplyManagerHelper
.
getCouponset
s
().
size
()
>
0
)
{
if
(
WarplyManagerHelper
.
getCouponsets
Deals
()
!=
null
&&
WarplyManagerHelper
.
getCouponsetsDeal
s
().
size
()
>
0
)
{
for
(
SharingCoupon
shCoupon
:
result
)
{
for
(
Couponset
cpnset
:
WarplyManagerHelper
.
getCouponsets
())
{
for
(
Couponset
cpnset
:
WarplyManagerHelper
.
getCouponsets
Deals
())
{
if
(
shCoupon
.
getCouponsetUuid
().
equals
(
cpnset
.
getUuid
()))
{
SharingCoupon
newShCoupon
=
new
SharingCoupon
();
newShCoupon
=
shCoupon
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
View file @
109ecee
...
...
@@ -55,6 +55,7 @@ import ly.warp.sdk.io.models.ActiveDFYCouponEventModel;
import
ly.warp.sdk.io.models.ActiveDFYCouponModel
;
import
ly.warp.sdk.io.models.Coupon
;
import
ly.warp.sdk.io.models.CouponList
;
import
ly.warp.sdk.io.models.Couponset
;
import
ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel
;
import
ly.warp.sdk.io.models.UnifiedCoupon
;
import
ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel
;
...
...
@@ -530,15 +531,29 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
// Third Expandable Banner
if
(
WarplyManagerHelper
.
getMarketCoupons
().
size
()
>
0
)
{
countValue
=
0.0f
;
for
(
UnifiedCoupon
unicou
:
WarplyManagerHelper
.
getMarketCoupons
())
{
if
(
unicou
.
getCoupons
()
!=
null
&&
unicou
.
getCoupons
().
size
()
>
0
)
{
for
(
Coupon
inncou
:
unicou
.
getCoupons
())
{
if
(
inncou
.
getStatus
()
==
0
)
{
countValue
+=
Float
.
valueOf
(
inncou
.
getDiscount
());
// for (UnifiedCoupon unicou : WarplyManagerHelper.getMarketCoupons()) {
// if (unicou.getCoupons() != null && unicou.getCoupons().size() > 0) {
// for (Coupon inncou : unicou.getCoupons()) {
// if (inncou.getStatus() == 0) {
// countValue += Float.valueOf(inncou.getDiscount());
// }
// }
// }
// }
if
(
WarplyManagerHelper
.
getCouponRedeemedList
().
size
()
>
0
)
{
if
(
WarplyManagerHelper
.
getCouponsetsDeals
().
size
()
>
0
)
{
for
(
Couponset
couset
:
WarplyManagerHelper
.
getCouponsetsDeals
())
{
for
(
Coupon
cou
:
WarplyManagerHelper
.
getCouponRedeemedList
())
{
if
(
cou
.
getCouponsetUuid
().
equals
(
couset
.
getUuid
()))
{
countValue
+=
Float
.
valueOf
(
cou
.
getDiscount
());
break
;
}
}
}
}
}
mFavValue
+=
countValue
;
String
badgeValue
=
String
.
format
(
"%.02f"
,
countValue
);
mTvMarketValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
));
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/ApiService.java
View file @
109ecee
...
...
@@ -43,6 +43,18 @@ public interface ApiService {
@Headers
(
"Content-Type: application/json"
)
@POST
(
"/oauth/{appUuid}/context"
)
Call
<
ResponseBody
>
getCouponsets
(
@Path
(
"appUuid"
)
String
appUuid
,
@Body
RequestBody
request
,
@Header
(
WarpConstants
.
HEADER_DATE
)
String
timeStamp
,
@Header
(
WarpConstants
.
HEADER_LOYALTY_BUNDLE_ID
)
String
bundleId
,
@Header
(
WarpConstants
.
HEADER_UNIQUE_DEVICE_ID
)
String
deviceId
,
@Header
(
WarpConstants
.
HEADER_CHANNEL
)
String
channel
,
@Header
(
WarpConstants
.
HEADER_WEB_ID
)
String
webId
,
@Header
(
WarpConstants
.
HEADER_SIGNATURE
)
String
signature
,
@Header
(
WarpConstants
.
HEADER_AUTHORIZATION
)
String
bearer
);
@Headers
(
"Content-Type: application/json"
)
@POST
(
"/oauth/{appUuid}/context"
)
Call
<
ResponseBody
>
getUserCoupons
(
@Path
(
"appUuid"
)
String
appUuid
,
@Body
RequestBody
request
,
@Header
(
WarpConstants
.
HEADER_DATE
)
String
timeStamp
,
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
109ecee
...
...
@@ -111,8 +111,10 @@ public class WarplyManagerHelper {
private
static
Consumer
mConsumerInternal
=
new
Consumer
();
private
static
HashMap
<
String
,
CampaignList
>
mUniqueCampaignList
=
new
HashMap
<
String
,
CampaignList
>();
private
static
CouponList
mCouponList
=
new
CouponList
();
private
static
CouponList
mCouponRedeemedList
=
new
CouponList
();
private
static
CouponList
mCouponListExpired
=
new
CouponList
();
private
static
CouponsetsList
mCouponsetsList
=
new
CouponsetsList
();
private
static
CouponsetsList
mCouponsetsDealsList
=
new
CouponsetsList
();
private
static
CustomerStateModel
mCustomerStateModel
=
new
CustomerStateModel
();
private
static
ArrayList
<
Campaign
>
mCampaignList
=
new
ArrayList
<
Campaign
>();
private
static
ArrayList
<
Campaign
>
mCampaignListAll
=
new
ArrayList
<
Campaign
>();
...
...
@@ -1231,6 +1233,15 @@ public class WarplyManagerHelper {
});
}
public
static
void
setCouponRedeemedList
(
CouponList
couponRedeemedList
)
{
mCouponRedeemedList
.
clear
();
mCouponRedeemedList
.
addAll
(
couponRedeemedList
);
}
public
static
CouponList
getCouponRedeemedList
()
{
return
mCouponRedeemedList
;
}
public
static
LoyaltyBadgeModel
getLoyaltyBadge
()
{
return
mLoyaltyBadge
;
}
...
...
@@ -1243,6 +1254,14 @@ public class WarplyManagerHelper {
mCouponsetsList
=
couponsets
;
}
public
static
void
setCouponsetsDeals
(
CouponsetsList
couponsetsDeals
)
{
mCouponsetsDealsList
=
couponsetsDeals
;
}
public
static
CouponsetsList
getCouponsetsDeals
()
{
return
mCouponsetsDealsList
;
}
public
static
void
setMerchantList
(
MerchantList
merchantList
)
{
mMerchantList
.
clear
();
mMerchantList
=
merchantList
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
109ecee
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment