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-16 16:16:38 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
54ab2d1b66b428b61c239740b61bd9ac929bcdc6
54ab2d1b
1 parent
048a4307
new keys
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
45 additions
and
35 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/GiftsForYouActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/NewCampaign.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/src/main/res/layout/activity_gifts_for_you.xml
warply_android_sdk/src/main/res/layout/activity_more_for_you.xml
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
View file @
54ab2d1
...
...
@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public
void
onWarplyReady
()
{
if
(!
WarplyDBHelper
.
getInstance
(
SplashActivity
.
this
).
isTableNotEmpty
(
"auth"
))
{
WarplyManager
.
getCosmoteUser
(
new
WarplyCosmoteUserRequest
()
.
setGuid
(
"7000000
831
"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons
.
setGuid
(
"7000000
900
"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons
mLoginReceiver
);
}
else
{
startNextActivity
();
...
...
warply_android_sdk/build.gradle
View file @
54ab2d1
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta6
6
'
PUBLISH_VERSION
=
'4.5.4-cosbeta6
9
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
@@ -55,7 +55,6 @@ dependencies {
api
group:
'com.google.zxing'
,
name:
'javase'
,
version:
'3.4.1'
api
'com.github.siyamed:android-shape-imageview:0.9.3'
implementation
'org.greenrobot:eventbus:3.3.1'
api
'com.google.android.flexbox:flexbox:3.0.0'
api
'org.apmem.tools:layouts:1.10'
//------------------------------ Firebase -----------------------------//
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/GiftsForYouActivity.java
View file @
54ab2d1
...
...
@@ -85,6 +85,8 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
mSeasonalList
.
clear
();
mSeasonalList
.
addAll
(
mHashSetSeasonalList
);
}
WarpUtils
.
log
(
"GFY_SEASONAL_LIST_COUNT: "
+
String
.
valueOf
(
mSeasonalList
.
size
()));
WarpUtils
.
log
(
"GFY_SEASONAL_LIST_JSON: "
+
String
.
valueOf
(
mSeasonalList
.
toString
()));
if
(
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
()
!=
null
&&
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
().
size
()
>
0
)
{
mContextualList
.
clear
();
...
...
@@ -94,6 +96,8 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
mContextualList
.
add
(
ccmsItem
);
}
}
WarpUtils
.
log
(
"GFY_CCMS_LIST_COUNT: "
+
String
.
valueOf
(
mContextualList
.
size
()));
WarpUtils
.
log
(
"GFY_CCMS_LIST_JSON: "
+
String
.
valueOf
(
mContextualList
.
toString
()));
mergeDatasets
(
mSeasonalList
,
...
...
@@ -472,9 +476,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
mValuesList
.
clear
();
ArrayList
<
Campaign
>
gfyList
=
new
ArrayList
<>();
if
(
WarplyManagerHelper
.
getCampaignListAll
()
!=
null
&&
WarplyManagerHelper
.
getCampaignListAll
().
size
()
>
0
)
{
Log
.
v
(
"Got L:{"
+
String
.
valueOf
(
WarplyManagerHelper
.
getCampaignListAll
().
size
())
+
"}"
,
" LOYALTY campaigns"
);
if
(
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
()
==
null
||
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
().
size
()
==
0
)
{
Log
.
v
(
"Got C:{0}"
,
" CCMS campaigns"
);
for
(
Campaign
camp
:
WarplyManagerHelper
.
getCampaignListAll
())
{
if
(
camp
.
getOfferCategory
().
equals
(
"gifts_for_you"
))
{
try
{
...
...
@@ -490,8 +492,6 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
}
}
}
else
{
int
ccmsCount
=
0
;
Log
.
v
(
"Got C:{"
+
String
.
valueOf
(
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
().
size
())
+
"}"
,
" CCMS campaigns"
);
for
(
Campaign
camp
:
WarplyManagerHelper
.
getCampaignListAll
())
{
if
(
camp
.
getOfferCategory
().
equals
(
"gifts_for_you"
))
{
try
{
...
...
@@ -501,7 +501,6 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
for
(
LoyaltyContextualOfferModel
ccms
:
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
())
{
if
(
ccms
.
getLoyaltyCampaignId
().
equals
(
camp
.
getSessionUUID
()))
{
gfyList
.
add
(
camp
);
ccmsCount
++;
break
;
}
}
...
...
@@ -514,14 +513,13 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
}
}
}
Log
.
v
(
"Got M:{"
+
String
.
valueOf
(
ccmsCount
)
+
"}"
,
" Matched campaigns"
);
}
WarpUtils
.
log
(
"GFY_FILTER_LIST_COUNT: "
+
String
.
valueOf
(
gfyList
.
size
()));
WarpUtils
.
log
(
"GFY_FILTER_LIST_JSON: "
+
String
.
valueOf
(
gfyList
.
toString
()));
mValuesList
.
addAll
(
gfyList
);
// HashSet hs = new HashSet();
// hs.addAll(mValuesList);
// mValuesList.clear();
// mValuesList.addAll(hs);
WarpUtils
.
log
(
"GFY_VAR_LIST_COUNT: "
+
String
.
valueOf
(
mValuesList
.
size
()));
WarpUtils
.
log
(
"GFY_VAR_LIST_JSON: "
+
String
.
valueOf
(
mValuesList
.
toString
()));
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
View file @
54ab2d1
...
...
@@ -411,9 +411,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
LinearLayout
v
=
(
LinearLayout
)
vi
.
inflate
(
R
.
layout
.
item_selectable
,
null
);
TextView
textView
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
tv_code_copy
);
TextView
textViewComma
=
(
TextView
)
v
.
findViewById
(
R
.
id
.
tv_code_comma
);
textView
.
setText
(
WarplyManagerHelper
.
getActiveDFYCoupons
().
get
(
i
).
getCode
());
CalligraphyTypefaceSpan
typefaceBoldSpan
=
new
CalligraphyTypefaceSpan
(
TypefaceUtils
.
load
(
getAssets
(),
"fonts/pf_square_sans_pro_bold.ttf"
));
SpannableStringBuilder
sBuilder
=
new
SpannableStringBuilder
(
WarplyManagerHelper
.
getActiveDFYCoupons
().
get
(
i
).
getCode
());
SpannableStringBuilder
sBuilderComma
=
new
SpannableStringBuilder
(
getString
(
R
.
string
.
cos_comma
));
sBuilder
.
setSpan
(
typefaceBoldSpan
,
0
,
sBuilder
.
length
(),
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
sBuilderComma
.
setSpan
(
typefaceBoldSpan
,
0
,
sBuilderComma
.
length
(),
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
textView
.
setText
(
sBuilder
,
TextView
.
BufferType
.
SPANNABLE
);
textView
.
setTextIsSelectable
(
true
);
textViewComma
.
setText
(
getString
(
R
.
string
.
cos_comma
)
);
textViewComma
.
setText
(
sBuilderComma
,
TextView
.
BufferType
.
SPANNABLE
);
mLlActiveCodesView
.
addView
(
v
,
0
,
new
ViewGroup
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
));
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/NewCampaign.java
View file @
54ab2d1
...
...
@@ -110,8 +110,8 @@ public class NewCampaign implements Parcelable, Serializable {
this
.
indexUrl
=
json
.
optString
(
INDEX_URL
);
this
.
logoUrl
=
json
.
optString
(
LOGO_URL
);
this
.
communicationUUID
=
json
.
optString
(
COMMUNICATION_UUID
);
this
.
subtitle
=
json
.
optString
(
SUBTITLE
);
this
.
message
=
json
.
optString
(
MESSAGE
);
this
.
subtitle
=
json
.
isNull
(
SUBTITLE
)
?
null
:
json
.
optString
(
SUBTITLE
);
this
.
message
=
json
.
isNull
(
MESSAGE
)
?
null
:
json
.
optString
(
MESSAGE
);
this
.
category
=
json
.
optString
(
CATEGORY
);
this
.
title
=
json
.
optString
(
TITLE
);
this
.
sorting
=
json
.
optInt
(
SORTING
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/services/WarplyHealthService.java
View file @
54ab2d1
...
...
@@ -56,7 +56,7 @@ public class WarplyHealthService extends Service implements SensorEventListener
private
SensorManager
mSensorManager
;
private
Sensor
mSensor
;
// private int mSteps = 0;
private
double
mStepsAll
=
0.0d
;
//
private double mStepsAll = 0.0d;
private
final
int
ACCEL_RING_SIZE
=
50
;
private
final
int
VEL_RING_SIZE
=
10
;
// change this threshold according to your sensitivity preferences
...
...
@@ -138,8 +138,8 @@ public class WarplyHealthService extends Service implements SensorEventListener
super
.
onDestroy
();
unregisterStepSensor
();
mStepsAll
=
0.0d
;
WarpUtils
.
setStepsMetersCounter
(
this
,
0.0d
);
//
mStepsAll = 0.0d;
//
WarpUtils.setStepsMetersCounter(this, 0.0d);
WarplyManagerHelper
.
mStepsWebview
=
0
;
WarplyManagerHelper
.
mMetersWebview
=
0.0d
;
sendSteps
();
...
...
@@ -212,14 +212,15 @@ public class WarplyHealthService extends Service implements SensorEventListener
&&
oldVelocityEstimate
<=
STEP_THRESHOLD
&&
(
timeNs
-
lastStepTimeNs
>
STEP_DELAY_NS
))
{
WarplyManagerHelper
.
mSteps
++;
mStepsAll
++;
WarpUtils
.
setStepsCounter
(
this
,
WarplyManagerHelper
.
mSteps
);
// mStepsAll++;
WarplyManagerHelper
.
mStepsWebview
++;
WarplyManagerHelper
.
mMetersWebview
=
(
WarplyManagerHelper
.
mStepsWebview
*
0.762
);
HealthEventModel
healthSteps
=
new
HealthEventModel
();
healthSteps
.
setMeters
((
mStepsAll
*
0.762
));
// healthSteps.setMeters((mStepsAll * 0.762));
healthSteps
.
setMeters
(
WarplyManagerHelper
.
mMetersWebview
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
healthSteps
));
WarpUtils
.
setStepsMetersCounter
(
this
,
(
mStepsAll
*
0.762
));
WarpUtils
.
setStepsCounter
(
this
,
WarplyManagerHelper
.
mSteps
);
// WarpUtils.setStepsMetersCounter(this, (mStepsAll * 0.762));
lastStepTimeNs
=
timeNs
;
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
54ab2d1
...
...
@@ -98,7 +98,7 @@ public class WarplyManagerHelper {
private
static
CustomerStateModel
mCustomerStateModel
=
new
CustomerStateModel
();
private
static
CampaignList
mCampaignList
=
new
CampaignList
();
private
static
CampaignList
mCampaignListAll
=
new
CampaignList
();
private
static
CampaignList
mCarouselList
=
new
CampaignList
();
private
static
ArrayList
<
Campaign
>
mCarouselList
=
new
ArrayList
<
Campaign
>
();
private
static
ArrayList
<
ActiveDFYCouponModel
>
mDfyCoupons
=
new
ArrayList
();
private
static
ArrayList
<
LoyaltyGiftsForYouPackage
>
mSeasonalList
=
new
ArrayList
<>();
private
static
ArrayList
<
LoyaltyContextualOfferModel
>
mCCMSList
=
new
ArrayList
<>();
...
...
@@ -1052,16 +1052,16 @@ public class WarplyManagerHelper {
}
}
public
static
void
setCarouselList
(
CampaignList
carouselList
)
{
public
static
void
setCarouselList
(
ArrayList
<
Campaign
>
carouselList
)
{
WarpUtils
.
log
(
"SET_CAROUSEL_LIST_PARAM_COUNT: "
+
String
.
valueOf
(
carouselList
.
size
()));
WarpUtils
.
log
(
"SET_CAROUSEL_LIST_PARAM_JSON: "
+
String
.
valueOf
(
carouselList
.
toString
()));
mCarouselList
.
clear
();
mCarouselList
=
carouselList
;
HashSet
hs
=
new
HashSet
();
hs
.
addAll
(
mCarouselList
);
mCarouselList
.
clear
();
mCarouselList
.
addAll
(
hs
);
mCarouselList
.
addAll
(
carouselList
);
WarpUtils
.
log
(
"SET_CAROUSEL_LIST_VAR_COUNT: "
+
String
.
valueOf
(
mCarouselList
.
size
()));
WarpUtils
.
log
(
"SET_CAROUSEL_LIST_VAR_JSON: "
+
String
.
valueOf
(
mCarouselList
.
toString
()));
}
public
static
CampaignList
getCarouselList
()
{
public
static
ArrayList
<
Campaign
>
getCarouselList
()
{
return
mCarouselList
;
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
54ab2d1
...
...
@@ -1403,7 +1403,7 @@ public class WarplyManager {
Collections
.
sort
(
mNewCampaignList
,
(
obj1
,
obj2
)
->
Integer
.
compare
(
obj1
.
getSorting
(),
obj2
.
getSorting
()));
CampaignList
campaignLoyaltyList
=
new
CampaignList
();
campaignLoyaltyList
.
clear
();
CampaignList
campaignCarouselList
=
new
CampaignList
();
ArrayList
<
Campaign
>
campaignCarouselList
=
new
ArrayList
<>
();
campaignCarouselList
.
clear
();
for
(
Campaign
camp
:
mNewCampaignList
)
{
JSONObject
campMetadata
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
...
...
warply_android_sdk/src/main/res/layout/activity_gifts_for_you.xml
View file @
54ab2d1
...
...
@@ -55,7 +55,7 @@
android:orientation=
"vertical"
android:paddingVertical=
"16dp"
android:visibility=
"gone"
tools:visibility=
"
visibl
e"
>
tools:visibility=
"
gon
e"
>
<ImageView
android:id=
"@+id/iv_popup_gifts_close"
...
...
@@ -101,6 +101,7 @@
android:layout_marginTop=
"4dp"
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:overScrollMode=
"never"
android:paddingTop=
"44dp"
/>
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
...
...
warply_android_sdk/src/main/res/layout/activity_more_for_you.xml
View file @
54ab2d1
...
...
@@ -49,7 +49,8 @@
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fillViewport=
"true"
>
android:fillViewport=
"true"
android:overScrollMode=
"never"
>
<RelativeLayout
android:layout_width=
"match_parent"
...
...
@@ -113,6 +114,7 @@
android:orientation=
"vertical"
android:paddingTop=
"44dp"
android:paddingBottom=
"24dp"
android:overScrollMode=
"never"
android:visibility=
"gone"
/>
<LinearLayout
...
...
@@ -141,6 +143,7 @@
android:layout_marginTop=
"4dp"
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:overScrollMode=
"never"
android:paddingBottom=
"4dp"
/>
</LinearLayout>
...
...
@@ -169,6 +172,7 @@
android:layout_marginTop=
"4dp"
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:overScrollMode=
"never"
android:paddingBottom=
"4dp"
/>
</LinearLayout>
...
...
@@ -197,6 +201,7 @@
android:layout_marginTop=
"4dp"
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:overScrollMode=
"never"
android:paddingBottom=
"4dp"
/>
</LinearLayout>
...
...
@@ -225,6 +230,7 @@
android:layout_marginTop=
"4dp"
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:overScrollMode=
"never"
android:paddingBottom=
"4dp"
/>
</LinearLayout>
</RelativeLayout>
...
...
Please
register
or
login
to post a comment