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-29 18:26:26 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
237b1b35b8b6026ff76545aacb33248e7203d5db
237b1b35
1 parent
2012f83d
new keys
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
15 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/WarpViewActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/services/WarplyHealthService.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
warply_android_sdk/build.gradle
View file @
237b1b3
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta7
7
'
PUBLISH_VERSION
=
'4.5.4-cosbeta7
8
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
View file @
237b1b3
This diff is collapsed. Click to expand it.
warply_android_sdk/src/main/java/ly/warp/sdk/activities/WarpViewActivity.java
View file @
237b1b3
...
...
@@ -317,7 +317,7 @@ public class WarpViewActivity extends WarpBaseActivity {
private
void
sendSteps
()
{
String
date
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm:ss"
,
Locale
.
getDefault
()).
format
(
new
Date
());
WarpUtils
.
log
(
"SEND_STEPS: "
+
String
.
valueOf
(
WarpUtils
.
getStepsCounter
(
this
)));
if
(
WarpUtils
.
getStepsCounter
(
this
)
>
0
)
{
WarplyManager
.
setPacingDetails
(
new
PacingCalculateRequest
()
.
setCounter
(
WarpUtils
.
getStepsCounter
(
this
))
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/services/WarplyHealthService.java
View file @
237b1b3
...
...
@@ -213,13 +213,16 @@ public class WarplyHealthService extends Service implements SensorEventListener
&&
(
timeNs
-
lastStepTimeNs
>
STEP_DELAY_NS
))
{
WarplyManagerHelper
.
mStepsWebview
++;
sumSteps
++;
WarplyManagerHelper
.
mSteps
+=
WarplyManagerHelper
.
mStepsWebview
;
WarplyManagerHelper
.
mSteps
++;
WarpUtils
.
log
(
"COUNT_STEPS: "
+
String
.
valueOf
(
WarplyManagerHelper
.
mSteps
));
WarpUtils
.
setStepsCounter
(
this
,
WarplyManagerHelper
.
mSteps
);
WarplyManagerHelper
.
mMetersWebview
=
(
WarplyManagerHelper
.
mStepsWebview
*
0.762
);
WarpUtils
.
log
(
"WEBVIEW_METERS: "
+
String
.
valueOf
(
WarplyManagerHelper
.
mMetersWebview
));
HealthEventModel
healthSteps
=
new
HealthEventModel
();
// healthSteps.setMeters((mStepsAll * 0.762)); // 16/09/2022
// healthSteps.setMeters(WarplyManagerHelper.mMetersWebview); // 20/09/2022
eventMeters
=
(
sumSteps
*
0.762
);
WarpUtils
.
log
(
"WIDGET_METERS: "
+
String
.
valueOf
(
eventMeters
));
healthSteps
.
setMeters
(
eventMeters
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
healthSteps
));
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
237b1b3
...
...
@@ -46,7 +46,9 @@ import java.io.Serializable;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.LinkedHashSet
;
import
java.util.Map
;
import
java.util.Set
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.Warply
;
...
...
@@ -105,8 +107,8 @@ public class WarplyManagerHelper {
private
static
CouponList
mCouponListExpired
=
new
CouponList
();
private
static
CouponsetsList
mCouponsetsList
=
new
CouponsetsList
();
private
static
CustomerStateModel
mCustomerStateModel
=
new
CustomerStateModel
();
private
static
CampaignList
mCampaignList
=
new
CampaignList
();
private
static
CampaignList
mCampaignListAll
=
new
CampaignList
();
private
static
ArrayList
<
Campaign
>
mCampaignList
=
new
ArrayList
<
Campaign
>
();
private
static
ArrayList
<
Campaign
>
mCampaignListAll
=
new
ArrayList
<
Campaign
>
();
private
static
ArrayList
<
Campaign
>
mCarouselList
=
new
ArrayList
<
Campaign
>();
private
static
ArrayList
<
ActiveDFYCouponModel
>
mDfyCoupons
=
new
ArrayList
();
private
static
ArrayList
<
LoyaltyGiftsForYouPackage
>
mSeasonalList
=
new
ArrayList
<>();
...
...
@@ -1077,7 +1079,7 @@ public class WarplyManagerHelper {
return
mCouponListExpired
;
}
public
static
void
setUniqueCampaignList
(
CampaignList
campaignList
)
{
public
static
void
setUniqueCampaignList
(
ArrayList
<
Campaign
>
campaignList
)
{
mCampaignList
.
clear
();
mCampaignList
.
addAll
(
campaignList
);
...
...
@@ -1097,12 +1099,12 @@ public class WarplyManagerHelper {
// }
}
public
static
void
setCampaignList
(
CampaignList
campaignList
)
{
public
static
void
setCampaignList
(
ArrayList
<
Campaign
>
campaignList
)
{
// mCampaignList.clear();
// mCampaignList.addAll(campaignList);
Set
<
Campaign
>
set
=
new
LinkedHashSet
<>(
campaignList
);
mCampaignListAll
.
clear
();
mCampaignListAll
.
addAll
(
campaignLis
t
);
mCampaignListAll
.
addAll
(
se
t
);
mCampaignList
.
clear
();
for
(
Campaign
camp
:
campaignList
)
{
...
...
@@ -1132,11 +1134,11 @@ public class WarplyManagerHelper {
return
mCarouselList
;
}
public
static
CampaignList
getCampaignList
()
{
public
static
ArrayList
<
Campaign
>
getCampaignList
()
{
return
mCampaignList
;
}
public
static
CampaignList
getCampaignListAll
()
{
public
static
ArrayList
<
Campaign
>
getCampaignListAll
()
{
return
mCampaignListAll
;
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
237b1b3
...
...
@@ -45,6 +45,8 @@ import java.util.ArrayList;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.LinkedHashSet
;
import
java.util.Set
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.Warply
;
...
...
@@ -147,7 +149,7 @@ import ly.warp.sdk.utils.constants.WarpConstants;
*/
public
class
WarplyManager
{
private
static
CampaignList
mNewCampaignList
=
new
CampaignList
();
private
static
ArrayList
<
Campaign
>
mNewCampaignList
=
new
ArrayList
<
Campaign
>
();
public
static
void
getProducts
(
WarplyProductsRequest
request
,
final
CallbackReceiver
<
ProductList
>
receiver
)
{
// String productCategory = "";
...
...
@@ -1372,7 +1374,8 @@ public class WarplyManager {
public
void
onSuccess
(
CampaignList
result
)
{
// receiver.onSuccess(result);
mNewCampaignList
.
clear
();
mNewCampaignList
.
addAll
(
result
);
ArrayList
<
Campaign
>
tempCamps
=
new
ArrayList
<
Campaign
>(
result
);
mNewCampaignList
.
addAll
(
tempCamps
);
getCampaignsPersonalized
(
request
,
new
CallbackReceiver
<
CampaignList
>()
{
@Override
public
void
onSuccess
(
CampaignList
resultPersonalized
)
{
...
...
@@ -1402,7 +1405,8 @@ public class WarplyManager {
Warply
.
postReceiveMicroappData
(
WarpConstants
.
MICROAPP_NEW_CAMPAIGNS
,
true
,
"campaignsPersonalized"
,
request
.
toJson
(),
new
NewCampaignsHook
(
new
CallbackReceiver
<
CampaignList
>()
{
@Override
public
void
onSuccess
(
CampaignList
result
)
{
mNewCampaignList
.
addAll
(
result
);
ArrayList
<
Campaign
>
tempCamps
=
new
ArrayList
<
Campaign
>(
result
);
mNewCampaignList
.
addAll
(
tempCamps
);
Collections
.
sort
(
mNewCampaignList
,
(
obj1
,
obj2
)
->
Integer
.
compare
(
obj1
.
getSorting
(),
obj2
.
getSorting
()));
CampaignList
campaignLoyaltyList
=
new
CampaignList
();
campaignLoyaltyList
.
clear
();
...
...
@@ -2023,7 +2027,11 @@ public class WarplyManager {
// }
// WarplyManagerHelper.setCCMSLoyaltyCampaigns(list);
receiver
.
onSuccess
(
campaignLoyaltyList
);
//result
CampaignList
tempAllCamps
=
new
CampaignList
();
Set
<
Campaign
>
set
=
new
LinkedHashSet
<>(
campaignLoyaltyList
);
tempAllCamps
.
clear
();
tempAllCamps
.
addAll
(
set
);
receiver
.
onSuccess
(
tempAllCamps
);
//result, //campaignLoyaltyList
}
@Override
...
...
Please
register
or
login
to post a comment