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-09-30 18:01:06 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4a8f9bbcf69b37f936e1d306ecc9d9bfe5ca2cb8
4a8f9bbc
1 parent
e9cc8711
minor fixes
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
27 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/GiftsForYouActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MoreForYouActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/services/WarplyHealthService.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
warply_android_sdk/build.gradle
View file @
4a8f9bb
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta
79
'
PUBLISH_VERSION
=
'4.5.4-cosbeta
80
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/GiftsForYouActivity.java
View file @
4a8f9bb
...
...
@@ -160,8 +160,34 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
if
(
requestCode
==
1004
)
{
OneTimeWorkRequest
mywork
=
new
OneTimeWorkRequest
.
Builder
(
EventCampaignService
.
class
).
build
();
WorkManager
.
getInstance
(
GiftsForYouActivity
.
this
).
enqueue
(
mywork
);
// OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
// WorkManager.getInstance(GiftsForYouActivity.this).enqueue(mywork);
filterItems
();
if
(
WarplyManagerHelper
.
getSeasonalList
()
!=
null
&&
WarplyManagerHelper
.
getSeasonalList
().
size
()
>
0
)
{
mHashSetSeasonalList
.
clear
();
mHashSetSeasonalList
.
addAll
(
WarplyManagerHelper
.
getSeasonalList
());
mSeasonalList
.
clear
();
mSeasonalList
.
addAll
(
mHashSetSeasonalList
);
}
if
(
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
()
!=
null
&&
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
().
size
()
>
0
)
{
mContextualList
.
clear
();
for
(
LoyaltyContextualOfferModel
ccmsItem
:
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
())
{
if
((
TextUtils
.
isEmpty
(
ccmsItem
.
getLoyaltyCampaignId
())
||
ccmsItem
.
getLoyaltyCampaignId
().
equals
(
"NA"
))
&&
ccmsItem
.
getZone
().
equals
(
"COSMOTE_APP_GIFTS4U"
))
mContextualList
.
add
(
ccmsItem
);
}
}
mergeDatasets
(
mSeasonalList
,
mContextualList
,
mValuesList
);
initViews2
();
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MoreForYouActivity.java
View file @
4a8f9bb
...
...
@@ -181,8 +181,34 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
if
(
requestCode
==
1003
)
{
OneTimeWorkRequest
mywork
=
new
OneTimeWorkRequest
.
Builder
(
EventCampaignService
.
class
).
build
();
WorkManager
.
getInstance
(
MoreForYouActivity
.
this
).
enqueue
(
mywork
);
// OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
// WorkManager.getInstance(MoreForYouActivity.this).enqueue(mywork);
// filterItems();
/** New Implementation */
filterItemsNew
();
/** New Implementation */
if
(
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
()
!=
null
&&
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
().
size
()
>
0
)
{
mContextualList
.
clear
();
for
(
LoyaltyContextualOfferModel
ccmsItem
:
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
())
{
if
((
TextUtils
.
isEmpty
(
ccmsItem
.
getLoyaltyCampaignId
())
||
ccmsItem
.
getLoyaltyCampaignId
().
equals
(
"NA"
))
&&
ccmsItem
.
getZone
().
equals
(
"COSMOTE_APP_MORE4U"
))
mContextualList
.
add
(
ccmsItem
);
}
}
// mergeDatasets(
// mValuesList,
// mContextualList
// );
// initViews2();
/** New Implementation */
initViewsNew2
();
/** New Implementation */
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/services/WarplyHealthService.java
View file @
4a8f9bb
...
...
@@ -57,7 +57,7 @@ public class WarplyHealthService extends Service implements SensorEventListener
private
final
int
ACCEL_RING_SIZE
=
50
;
private
final
int
VEL_RING_SIZE
=
10
;
// change this threshold according to your sensitivity preferences
private
final
float
STEP_THRESHOLD
=
6
0
f
;
// default 40, cosmote default 20
private
final
float
STEP_THRESHOLD
=
2
0
f
;
// default 40, cosmote default 20
private
final
int
STEP_DELAY_NS
=
250000000
;
private
int
accelRingCounter
=
0
;
private
float
[]
accelRingX
=
new
float
[
ACCEL_RING_SIZE
];
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
4a8f9bb
...
...
@@ -1364,21 +1364,20 @@ public class WarplyManager {
});
}
public
static
void
getCampaigns
(
WarplyGetCampaignsRequest
request
,
final
CallbackReceiver
<
CampaignList
>
receiver
)
{
public
static
void
getCampaigns
(
WarplyGetCampaignsRequest
request
,
final
CallbackReceiver
<
ArrayList
<
Campaign
>
>
receiver
)
{
WarpUtils
.
log
(
"************* WARPLY Get Campaigns Request ********************"
);
WarpUtils
.
log
(
"[WARP Trace] WARPLY Get Campaigns Request is active"
);
WarpUtils
.
log
(
"**************************************************"
);
Warply
.
postReceiveMicroappData
(
WarpConstants
.
MICROAPP_NEW_CAMPAIGNS
,
false
,
"campaigns"
,
request
.
toJson
(),
new
NewCampaignsHook
(
new
CallbackReceiver
<
CampaignList
>()
{
Warply
.
postReceiveMicroappData
(
WarpConstants
.
MICROAPP_NEW_CAMPAIGNS
,
false
,
"campaigns"
,
request
.
toJson
(),
new
NewCampaignsHook
(
new
CallbackReceiver
<
ArrayList
<
Campaign
>
>()
{
@Override
public
void
onSuccess
(
CampaignList
result
)
{
public
void
onSuccess
(
ArrayList
<
Campaign
>
result
)
{
// receiver.onSuccess(result);
mNewCampaignList
.
clear
();
ArrayList
<
Campaign
>
tempCamps
=
new
ArrayList
<
Campaign
>(
result
);
mNewCampaignList
.
addAll
(
tempCamps
);
getCampaignsPersonalized
(
request
,
new
CallbackReceiver
<
CampaignList
>()
{
mNewCampaignList
.
addAll
(
result
);
getCampaignsPersonalized
(
request
,
new
CallbackReceiver
<
ArrayList
<
Campaign
>>()
{
@Override
public
void
onSuccess
(
CampaignList
resultPersonalized
)
{
public
void
onSuccess
(
ArrayList
<
Campaign
>
resultPersonalized
)
{
receiver
.
onSuccess
(
resultPersonalized
);
}
...
...
@@ -1397,18 +1396,17 @@ public class WarplyManager {
request
.
getSignature
()));
}
public
static
void
getCampaignsPersonalized
(
WarplyGetCampaignsRequest
request
,
final
CallbackReceiver
<
CampaignList
>
receiver
)
{
public
static
void
getCampaignsPersonalized
(
WarplyGetCampaignsRequest
request
,
final
CallbackReceiver
<
ArrayList
<
Campaign
>
>
receiver
)
{
WarpUtils
.
log
(
"************* WARPLY Get Campaigns Request ********************"
);
WarpUtils
.
log
(
"[WARP Trace] WARPLY Get Campaigns Request is active"
);
WarpUtils
.
log
(
"**************************************************"
);
Warply
.
postReceiveMicroappData
(
WarpConstants
.
MICROAPP_NEW_CAMPAIGNS
,
true
,
"campaignsPersonalized"
,
request
.
toJson
(),
new
NewCampaignsHook
(
new
CallbackReceiver
<
CampaignList
>()
{
Warply
.
postReceiveMicroappData
(
WarpConstants
.
MICROAPP_NEW_CAMPAIGNS
,
true
,
"campaignsPersonalized"
,
request
.
toJson
(),
new
NewCampaignsHook
(
new
CallbackReceiver
<
ArrayList
<
Campaign
>
>()
{
@Override
public
void
onSuccess
(
CampaignList
result
)
{
ArrayList
<
Campaign
>
tempCamps
=
new
ArrayList
<
Campaign
>(
result
);
mNewCampaignList
.
addAll
(
tempCamps
);
public
void
onSuccess
(
ArrayList
<
Campaign
>
result
)
{
mNewCampaignList
.
addAll
(
result
);
Collections
.
sort
(
mNewCampaignList
,
(
obj1
,
obj2
)
->
Integer
.
compare
(
obj1
.
getSorting
(),
obj2
.
getSorting
()));
CampaignList
campaignLoyaltyList
=
new
CampaignList
();
ArrayList
<
Campaign
>
campaignLoyaltyList
=
new
ArrayList
<>
();
campaignLoyaltyList
.
clear
();
ArrayList
<
Campaign
>
campaignCarouselList
=
new
ArrayList
<>();
campaignCarouselList
.
clear
();
...
...
@@ -2027,11 +2025,10 @@ public class WarplyManager {
// }
// WarplyManagerHelper.setCCMSLoyaltyCampaigns(list);
CampaignList
tempAllCamps
=
new
CampaignList
();
Set
<
Campaign
>
set
=
new
LinkedHashSet
<>(
campaignLoyaltyList
);
tempAllCamps
.
clear
();
tempAllCamps
.
addAll
(
set
);
receiver
.
onSuccess
(
tempAllCamps
);
//result, //campaignLoyaltyLis
t
campaignLoyaltyList
.
clear
();
campaignLoyaltyList
.
addAll
(
set
);
receiver
.
onSuccess
(
campaignLoyaltyList
);
//resul
t
}
@Override
...
...
@@ -2594,9 +2591,9 @@ public class WarplyManager {
new
CallbackReceiver
<
JSONObject
>()
{
@Override
public
void
onSuccess
(
JSONObject
result
)
{
WarplyManager
.
getCampaigns
(
new
WarplyGetCampaignsRequest
().
setLanguage
(
"en"
),
new
CallbackReceiver
<
CampaignList
>()
{
getCampaigns
(
new
WarplyGetCampaignsRequest
().
setLanguage
(
"en"
),
new
CallbackReceiver
<
ArrayList
<
Campaign
>
>()
{
@Override
public
void
onSuccess
(
CampaignList
result
)
{
public
void
onSuccess
(
ArrayList
<
Campaign
>
result
)
{
OneTimeWorkRequest
mywork
=
new
OneTimeWorkRequest
.
Builder
(
EventCampaignService
.
class
).
build
();
WorkManager
.
getInstance
(
Warply
.
getWarplyContext
()).
enqueue
(
mywork
);
}
...
...
@@ -2610,9 +2607,9 @@ public class WarplyManager {
@Override
public
void
onFailure
(
int
errorCode
)
{
WarplyManager
.
getCampaigns
(
new
WarplyGetCampaignsRequest
().
setLanguage
(
"en"
),
new
CallbackReceiver
<
CampaignList
>()
{
getCampaigns
(
new
WarplyGetCampaignsRequest
().
setLanguage
(
"en"
),
new
CallbackReceiver
<
ArrayList
<
Campaign
>
>()
{
@Override
public
void
onSuccess
(
CampaignList
result
)
{
public
void
onSuccess
(
ArrayList
<
Campaign
>
result
)
{
OneTimeWorkRequest
mywork
=
new
OneTimeWorkRequest
.
Builder
(
EventCampaignService
.
class
).
build
();
WorkManager
.
getInstance
(
Warply
.
getWarplyContext
()).
enqueue
(
mywork
);
}
...
...
Please
register
or
login
to post a comment