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
2022-03-29 14:59:50 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
11062c15d403bb9fd4c6df913aed594e6cfa3b3d
11062c15
1 parent
a187c60a
fixed coupons
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
2 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Coupon.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
View file @
11062c1
...
...
@@ -24,10 +24,15 @@ import ly.warp.sdk.io.callbacks.CallbackReceiver;
import
ly.warp.sdk.io.models.Campaign
;
import
ly.warp.sdk.io.models.CampaignList
;
import
ly.warp.sdk.io.models.Consumer
;
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.CouponsetsList
;
import
ly.warp.sdk.io.request.WarplyConsumerRequest
;
import
ly.warp.sdk.io.request.WarplyGetCouponsetsRequest
;
import
ly.warp.sdk.io.request.WarplyInboxRequest
;
import
ly.warp.sdk.io.request.WarplyUserCouponsRequest
;
import
ly.warp.sdk.utils.WarplyProperty
;
import
ly.warp.sdk.utils.managers.WarplyManager
;
import
ly.warp.sdk.utils.managers.WarplySessionManager
;
...
...
@@ -45,7 +50,8 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
private
Fragment
mFragmentToSet
=
null
;
private
static
Consumer
mConsumer
;
private
static
HashMap
mUniqueCampaignList
=
new
HashMap
<
String
,
CampaignList
>();
private
static
CouponList
mCouponList
;
private
static
CouponList
mCouponList
=
new
CouponList
();
private
CouponsetsList
mCouponsetsList
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -175,6 +181,22 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
}
// Thread.currentThread().interrupt();
WarplyManager
.
getCouponsets
(
new
WarplyGetCouponsetsRequest
()
.
setLanguage
(
WarplyProperty
.
getLanguage
(
BaseFragmentActivity
.
this
)),
mCouponsetsReceiver
);
}
@Override
public
void
onFailure
(
int
errorCode
)
{
Thread
.
currentThread
().
interrupt
();
}
};
private
CallbackReceiver
<
CouponsetsList
>
mCouponsetsReceiver
=
new
CallbackReceiver
<
CouponsetsList
>()
{
@Override
public
void
onSuccess
(
CouponsetsList
result
)
{
mCouponsetsList
=
result
;
WarplyManager
.
getUserCoupons
(
new
WarplyUserCouponsRequest
(),
mUserCouponsReceiver
);
}
...
...
@@ -184,10 +206,21 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
}
};
private
final
CallbackReceiver
<
CouponList
>
mUserCouponsReceiver
=
new
CallbackReceiver
<
CouponList
>()
{
@Override
public
void
onSuccess
(
CouponList
result
)
{
mCouponList
=
result
;
for
(
Coupon
coupon
:
result
)
{
for
(
Couponset
couponset
:
mCouponsetsList
)
{
if
(
coupon
.
getCouponsetUuid
().
equals
(
couponset
.
getUuid
()))
{
coupon
.
setDescription
(
couponset
.
getShortDescription
());
coupon
.
setImage
(
couponset
.
getImgPreview
());
coupon
.
setName
(
couponset
.
getName
());
mCouponList
.
add
(
coupon
);
}
}
}
Thread
.
currentThread
().
interrupt
();
new
Handler
(
Looper
.
getMainLooper
()).
post
(()
->
{
initViews
();
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Coupon.java
View file @
11062c1
...
...
@@ -263,6 +263,62 @@ public class Coupon implements Parcelable, Serializable {
return
couponsetUuid
;
}
public
void
setBarcode
(
String
barcode
)
{
this
.
barcode
=
barcode
;
}
public
void
setCategory
(
String
category
)
{
this
.
category
=
category
;
}
public
void
setCoupon
(
String
coupon
)
{
this
.
coupon
=
coupon
;
}
public
void
setCreated
(
String
created
)
{
this
.
created
=
created
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
void
setDiscount
(
String
discount
)
{
this
.
discount
=
discount
;
}
public
void
setExpiration
(
String
expiration
)
{
this
.
expiration
=
expiration
;
}
public
void
setImage
(
String
image
)
{
this
.
image
=
image
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
void
setTransactionDate
(
String
transactionDate
)
{
this
.
transactionDate
=
transactionDate
;
}
public
void
setTransactionUuid
(
String
transactionUuid
)
{
this
.
transactionUuid
=
transactionUuid
;
}
public
void
setChangesDates
(
JSONObject
changesDates
)
{
this
.
changesDates
=
changesDates
;
}
public
void
setCouponsetUuid
(
String
couponsetUuid
)
{
this
.
couponsetUuid
=
couponsetUuid
;
}
@Override
public
int
describeContents
()
{
return
0
;
...
...
Please
register
or
login
to post a comment