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
2024-04-01 12:37:16 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6b636b4546041d80550c358b725440a6644d2fc1
6b636b45
1 parent
8f7ba107
feedback additions and changes
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
38 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Campaign.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/NewCampaign.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
warply_android_sdk/build.gradle
View file @
6b636b4
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.5.4r1
5
'
PUBLISH_VERSION
=
'4.5.5.4r1
6
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Campaign.java
View file @
6b636b4
...
...
@@ -109,6 +109,7 @@ public class Campaign implements Parcelable, Serializable {
private
Integer
couponAvailability
;
private
String
endDate
,
startDate
;
private
boolean
showExpiration
;
private
String
couponImg
;
/**
* Basic constructor used to create an object from a String, representing a
...
...
@@ -153,6 +154,7 @@ public class Campaign implements Parcelable, Serializable {
this
.
endDate
=
""
;
this
.
startDate
=
""
;
this
.
showExpiration
=
false
;
this
.
couponImg
=
""
;
}
/**
...
...
@@ -688,6 +690,14 @@ public class Campaign implements Parcelable, Serializable {
this
.
showExpiration
=
showExpiration
;
}
public
String
getCouponImg
()
{
return
couponImg
;
}
public
void
setCouponImg
(
String
couponImg
)
{
this
.
couponImg
=
couponImg
;
}
@Override
public
int
describeContents
()
{
return
0
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/NewCampaign.java
View file @
6b636b4
...
...
@@ -94,6 +94,7 @@ public class NewCampaign implements Parcelable, Serializable {
private
String
bannerImage
=
""
;
private
String
bannerTitle
=
""
;
private
boolean
showExpiration
=
false
;
private
String
couponImg
=
""
;
/**
* Basic constructor used to create an object from a String, representing a
...
...
@@ -146,6 +147,7 @@ public class NewCampaign implements Parcelable, Serializable {
this
.
showExpiration
=
false
;
}
}
this
.
couponImg
=
json
.
optString
(
"coupon_img"
);
}
public
NewCampaign
(
Parcel
source
)
{
...
...
@@ -392,6 +394,14 @@ public class NewCampaign implements Parcelable, Serializable {
this
.
showExpiration
=
showExpiration
;
}
public
String
getCouponImg
()
{
return
couponImg
;
}
public
void
setCouponImg
(
String
couponImg
)
{
this
.
couponImg
=
couponImg
;
}
@Override
public
int
describeContents
()
{
return
0
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
6b636b4
...
...
@@ -1769,6 +1769,7 @@ public class WarplyManager {
camp
.
setEndDate
(
newCamp
.
getEndDate
());
camp
.
setStartDate
(
newCamp
.
getStartDate
());
camp
.
setShowExpiration
(
newCamp
.
isShowExpiration
());
camp
.
setCouponImg
(
newCamp
.
getCouponImg
());
try
{
camp
.
setExtraFields
(
newCamp
.
getExtraFields
().
toString
());
if
(!
TextUtils
.
isEmpty
(
newCamp
.
getExtraFields
().
toString
()))
{
...
...
@@ -1916,6 +1917,7 @@ public class WarplyManager {
camp
.
setEndDate
(
newCamp
.
getEndDate
());
camp
.
setStartDate
(
newCamp
.
getStartDate
());
camp
.
setShowExpiration
(
newCamp
.
isShowExpiration
());
camp
.
setCouponImg
(
newCamp
.
getCouponImg
());
try
{
camp
.
setExtraFields
(
newCamp
.
getExtraFields
().
toString
());
if
(!
TextUtils
.
isEmpty
(
newCamp
.
getExtraFields
().
toString
()))
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
View file @
6b636b4
...
...
@@ -88,6 +88,8 @@ import java.util.Map;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.activities.ActiveCouponsActivity
;
import
ly.warp.sdk.activities.ActiveUnifiedCouponsActivity
;
import
ly.warp.sdk.activities.BaseFragmentActivity
;
import
ly.warp.sdk.activities.CouponsetInfoActivity
;
import
ly.warp.sdk.activities.WarpViewActivity
;
import
ly.warp.sdk.db.WarplyDBHelper
;
...
...
@@ -101,6 +103,7 @@ import ly.warp.sdk.io.models.OpenMyRewardsEventModel;
import
ly.warp.sdk.io.models.QuestionnaireEventModel
;
import
ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel
;
import
ly.warp.sdk.io.models.RefreshVouchersEventModel
;
import
ly.warp.sdk.io.models.UnifiedCoupon
;
import
ly.warp.sdk.io.models.WarplyCCMSEnabledModel
;
import
ly.warp.sdk.io.models.WarplyCouponsChangedEventModel
;
import
ly.warp.sdk.io.models.WarplyPacingCardEventModel
;
...
...
@@ -516,22 +519,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
vouchersRefreshed
.
setRefreshed
(
true
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
vouchersRefreshed
));
}
else
if
(
parts
[
1
].
equals
(
"activeCoupons"
))
{
new
Thread
(()
->
{
if
(!
Thread
.
currentThread
().
isInterrupted
())
{
WarplyManager
.
getUserCouponsWithCouponsets
(
mUserCouponsReceiver
);
WarplyManager
.
getCampaigns
(
mCampaignsCallback
);
}
}).
start
();
Handler
handlerIntent
=
new
Handler
();
Runnable
runnableIntent
=
new
Runnable
()
{
@Override
public
void
run
()
{
Intent
intent
=
new
Intent
((
WarpActivity
!=
null
&&
!
WarpActivity
.
isFinishing
())
?
WarpActivity
:
getContext
(),
ActiveCouponsActivity
.
class
);
getContext
().
startActivity
(
intent
);
}
};
handlerIntent
.
postDelayed
(
runnableIntent
,
1500
);
WarplyManager
.
getUnifiedCouponsDeals
(
mUnifiedCallback
);
}
else
if
(
parts
[
1
].
equals
(
"ccmsRetrieved"
))
{
WarplyCCMSEnabledModel
ccmsEnabled
=
new
WarplyCCMSEnabledModel
();
ccmsEnabled
.
setActivated
(
true
);
...
...
@@ -899,32 +887,17 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
}
}
private
final
CallbackReceiver
<
CouponList
>
mUserCouponsReceiver
=
new
CallbackReceiver
<
CouponList
>()
{
private
final
CallbackReceiver
<
ArrayList
<
UnifiedCoupon
>>
mUnifiedCallback
=
new
CallbackReceiver
<
ArrayList
<
UnifiedCoupon
>
>()
{
@Override
public
void
onSuccess
(
CouponList
result
)
{
// Thread.currentThread().interrupt();
WarplyCouponsChangedEventModel
couponsChanged
=
new
WarplyCouponsChangedEventModel
();
couponsChanged
.
setChanged
(
true
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
couponsChanged
));
}
@Override
public
void
onFailure
(
int
errorCode
)
{
Thread
.
currentThread
().
interrupt
();
}
};
private
CallbackReceiver
<
ArrayList
<
Campaign
>>
mCampaignsCallback
=
new
CallbackReceiver
<
ArrayList
<
Campaign
>>()
{
@Override
public
void
onSuccess
(
ArrayList
<
Campaign
>
result
)
{
OneTimeWorkRequest
mywork
=
new
OneTimeWorkRequest
.
Builder
(
EventCampaignService
.
class
).
build
();
WorkManager
.
getInstance
((
WarpActivity
!=
null
&&
!
WarpActivity
.
isFinishing
())
?
WarpActivity
:
getContext
()).
enqueue
(
mywork
);
// Thread.currentThread().interrupt();
public
void
onSuccess
(
ArrayList
<
UnifiedCoupon
>
result
)
{
Intent
intent
=
new
Intent
((
WarpActivity
!=
null
&&
!
WarpActivity
.
isFinishing
())
?
WarpActivity
:
getContext
(),
ActiveUnifiedCouponsActivity
.
class
);
getContext
().
startActivity
(
intent
);
}
@Override
public
void
onFailure
(
int
errorCode
)
{
Thread
.
currentThread
().
interrupt
();
Intent
intent
=
new
Intent
((
WarpActivity
!=
null
&&
!
WarpActivity
.
isFinishing
())
?
WarpActivity
:
getContext
(),
ActiveUnifiedCouponsActivity
.
class
);
getContext
().
startActivity
(
intent
);
}
};
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment