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-10-06 16:13:50 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
58fafc42e65f2009bb32eb6b06370f5aa819743f
58fafc42
1 parent
64ba6f07
ui fixes, events, steps fix
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
408 additions
and
88 deletions
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
warply_android_sdk/src/main/AndroidManifest.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponsetInfoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/GiftsForYouActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyAnalysisActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MoreForYouActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/TelcoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Coupon.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Couponset.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/java/ly/warp/sdk/views/WarpView.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/ActiveCouponAdapter.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MergedGiftsAdapter.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MoreContextualAdapter.java
warply_android_sdk/src/main/res/drawable-xhdpi/ic_coupon_background_new.png
warply_android_sdk/src/main/res/drawable-xhdpi/ic_down_dark_new.png
warply_android_sdk/src/main/res/drawable-xhdpi/ic_up_dark_new.png
warply_android_sdk/src/main/res/layout/active_coupon_layout.xml
warply_android_sdk/src/main/res/layout/activity_coupon_info.xml
warply_android_sdk/src/main/res/layout/activity_coupon_share.xml
warply_android_sdk/src/main/res/layout/activity_couponset_info.xml
warply_android_sdk/src/main/res/layout/activity_telco.xml
warply_android_sdk/src/main/res/values/strings.xml
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
View file @
58fafc4
...
...
@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public
void
onWarplyReady
()
{
if
(!
WarplyDBHelper
.
getInstance
(
SplashActivity
.
this
).
isTableNotEmpty
(
"auth"
))
{
WarplyManager
.
getCosmoteUser
(
new
WarplyCosmoteUserRequest
()
.
setGuid
(
"700000
1315
"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons
.
setGuid
(
"700000
0831
"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons
mLoginReceiver
);
}
else
{
startNextActivity
();
...
...
warply_android_sdk/src/main/AndroidManifest.xml
View file @
58fafc4
...
...
@@ -168,6 +168,8 @@
<service
android:name=
"ly.warp.sdk.services.WarplyHealthService"
android:exported=
"false"
android:stopWithTask=
"false"
android:process=
":warplyHealthService"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<service
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
View file @
58fafc4
...
...
@@ -130,14 +130,14 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
TextView
barcodeButtonTitle
=
mLlBarcodeShown
.
findViewById
(
R
.
id
.
tv_barcode
);
ImageView
barcodeButtonArrow
=
mLlBarcodeShown
.
findViewById
(
R
.
id
.
iv_barcode_arrow
);
barcodeButtonTitle
.
setText
(
getString
(
R
.
string
.
cos_show_barcode
));
barcodeButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
arrow_down_dark
));
barcodeButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
down_dark_new
));
mIsBarcodeShown
=
false
;
}
else
{
mLlBarcodeContainer
.
setVisibility
(
View
.
VISIBLE
);
TextView
barcodeButtonTitle
=
mLlBarcodeShown
.
findViewById
(
R
.
id
.
tv_barcode
);
ImageView
barcodeButtonArrow
=
mLlBarcodeShown
.
findViewById
(
R
.
id
.
iv_barcode_arrow
);
barcodeButtonTitle
.
setText
(
getString
(
R
.
string
.
cos_hide_barcode
));
barcodeButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
arrow_up_dark
));
barcodeButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
up_dark_new
));
mIsBarcodeShown
=
true
;
}
return
;
...
...
@@ -146,12 +146,12 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
if
(
mIsTermsShown
)
{
mTvTermsValue
.
setVisibility
(
View
.
GONE
);
ImageView
termsButtonArrow
=
mLlTerms
.
findViewById
(
R
.
id
.
iv_terms_arrow
);
termsButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
arrow_down_dark
));
termsButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
down_dark_new
));
mIsTermsShown
=
false
;
}
else
{
mTvTermsValue
.
setVisibility
(
View
.
VISIBLE
);
ImageView
termsButtonArrow
=
mLlTerms
.
findViewById
(
R
.
id
.
iv_terms_arrow
);
termsButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
arrow_up_dark
));
termsButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
up_dark_new
));
mIsTermsShown
=
true
;
}
}
...
...
@@ -226,9 +226,13 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
tempCoupon
+=
"0"
;
}
try
{
for
(
int
i
=
mCoupon
.
getCoupon
().
length
()
-
1
;
i
>=
0
;
i
--)
{
result
=
result
+
Integer
.
parseInt
(
String
.
valueOf
((
mCoupon
.
getCoupon
()).
charAt
(
i
)))
*
(
1
+
(
2
*
(
i
%
2
)));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
tempCoupon
=
tempCoupon
+
(
10
-
(
result
%
10
))
%
10
;
createBarcodeBitmap
(
tempCoupon
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponsetInfoActivity.java
View file @
58fafc4
...
...
@@ -144,11 +144,11 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
if
(
mIsTermsPressed
)
{
mIsTermsPressed
=
false
;
mTvTermsValue
.
setVisibility
(
View
.
GONE
);
mIvTermsArrow
.
setImageDrawable
(
getDrawable
(
R
.
drawable
.
ic_down_dark
));
mIvTermsArrow
.
setImageDrawable
(
getDrawable
(
R
.
drawable
.
ic_down_dark
_new
));
}
else
{
mIsTermsPressed
=
true
;
mTvTermsValue
.
setVisibility
(
View
.
VISIBLE
);
mIvTermsArrow
.
setImageDrawable
(
getDrawable
(
R
.
drawable
.
ic_up_dark
));
mIvTermsArrow
.
setImageDrawable
(
getDrawable
(
R
.
drawable
.
ic_up_dark
_new
));
}
}
}
...
...
@@ -264,6 +264,14 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
dialogPositive
.
dismiss
();
})
.
show
();
}
else
if
(
status
==
6
)
{
mAlertDialogCouponset
=
new
AlertDialog
.
Builder
(
this
)
.
setTitle
(
R
.
string
.
cos_dlg_coupon_depleted_title
)
.
setMessage
(
R
.
string
.
cos_dlg_coupon_depleted_message
)
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button2
,
(
dialogPositive
,
whichPositive
)
->
{
dialogPositive
.
dismiss
();
})
.
show
();
}
else
{
mAlertDialogCouponset
=
new
AlertDialog
.
Builder
(
this
)
.
setTitle
(
R
.
string
.
cos_dlg_error_title
)
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/GiftsForYouActivity.java
View file @
58fafc4
...
...
@@ -4,6 +4,7 @@ import android.app.Activity;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.view.View
;
...
...
@@ -68,6 +69,8 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
private
ArrayList
<
LoyaltyGiftsForYouPackage
>
mSeasonalList
=
new
ArrayList
<>();
private
HashSet
<
LoyaltyGiftsForYouPackage
>
mHashSetSeasonalList
=
new
HashSet
<>();
private
ArrayList
<
LoyaltyContextualOfferModel
>
mContextualList
=
new
ArrayList
<>();
private
int
mTimer
=
0
;
private
Handler
mSecondsHandler
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -77,13 +80,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_gifts_for_you
);
// if (WarplyManagerHelper.getUniqueCampaignList().get("gifts_for_you") != null && WarplyManagerHelper.getUniqueCampaignList().get("gifts_for_you").size() > 0) {
// mHashSetList.addAll(WarplyManagerHelper.getUniqueCampaignList().get("gifts_for_you"));
// mValuesList.clear();
// mValuesList.addAll(mHashSetList);
// }
mSecondsHandler
=
new
Handler
();
filterItems
();
if
(
WarplyManagerHelper
.
getSeasonalList
()
!=
null
&&
WarplyManagerHelper
.
getSeasonalList
().
size
()
>
0
)
{
...
...
@@ -92,8 +89,6 @@ 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
();
...
...
@@ -103,8 +98,6 @@ 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
,
...
...
@@ -125,6 +118,33 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
@Override
public
void
onResume
()
{
super
.
onResume
();
mTimer
=
0
;
mSecondsHandler
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
mTimer
++;
mSecondsHandler
.
postDelayed
(
this
,
1000
);
}
});
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
}
@Override
public
void
onPause
()
{
super
.
onPause
();
if
(
mSecondsHandler
!=
null
)
{
mSecondsHandler
.
removeCallbacksAndMessages
(
null
);
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"time_spent_on_loyalty_sdk"
);
analyticsEvent
.
setParameter
(
"name"
,
"GiftsForYou"
);
analyticsEvent
.
setParameter
(
"seconds"
,
String
.
valueOf
(
mTimer
));
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
}
@Override
...
...
@@ -191,7 +211,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
mValuesList
);
runOnUiThread
(
this
::
initViews
2
);
runOnUiThread
(
this
::
initViews
);
}
}
...
...
@@ -209,8 +229,8 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
if
(
mData
!=
null
&&
mData
.
size
()
>
0
)
{
mRecyclerMergedGifts
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
mAdapterMergedGifts
=
new
MergedGiftsAdapter
(
this
,
mData
);
mAdapterMergedGifts
.
setHasStableIds
(
true
);
mRecyclerMergedGifts
.
setItemAnimator
(
null
);
//
mAdapterMergedGifts.setHasStableIds(true);
//
mRecyclerMergedGifts.setItemAnimator(null);
mRecyclerMergedGifts
.
setAdapter
(
mAdapterMergedGifts
);
mAdapterMergedGifts
.
getPositionClicks
()
.
doOnNext
(
dataItem
->
{
...
...
@@ -301,6 +321,12 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
if
(
extraFields
.
has
(
"type"
)
&&
extraFields
.
optString
(
"type"
).
equals
(
"telco"
))
{
for
(
LoyaltyContextualOfferModel
ccms
:
WarplyManagerHelper
.
getCCMSLoyaltyCampaigns
())
{
if
(
ccms
.
getLoyaltyCampaignId
().
equals
(
dataItem
.
getCampaign
().
getSessionUUID
()))
{
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"loyalty_sdk_offer_selected"
);
analyticsEvent
.
setParameter
(
"name"
,
ccms
.
getTitle
());
analyticsEvent
.
setParameter
(
"type"
,
"gift"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
WarplyManager
.
getSingleCampaign
(
dataItem
.
getCampaign
().
getSessionUUID
());
Intent
intent
=
new
Intent
(
GiftsForYouActivity
.
this
,
TelcoActivity
.
class
);
intent
.
putExtra
(
"ccms"
,
ccms
);
...
...
@@ -332,6 +358,12 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
seasonalCLick
.
setImageUrl
(
dataItem
.
getSeasonalList
().
getImageUrl
());
seasonalCLick
.
setContext
(
GiftsForYouActivity
.
this
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
seasonalCLick
));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"loyalty_sdk_offer_selected"
);
analyticsEvent
.
setParameter
(
"name"
,
dataItem
.
getSeasonalList
().
getTitle
());
analyticsEvent
.
setParameter
(
"type"
,
"seasonal"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
else
if
(
dataItem
.
getDataType
()
==
3
)
{
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"loyalty_sdk_offer_selected"
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyAnalysisActivity.java
View file @
58fafc4
...
...
@@ -4,6 +4,7 @@ import android.app.Activity;
import
android.content.Context
;
import
android.graphics.Typeface
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.text.SpannableStringBuilder
;
import
android.text.Spanned
;
import
android.view.View
;
...
...
@@ -16,6 +17,8 @@ import androidx.core.content.ContextCompat;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
org.greenrobot.eventbus.EventBus
;
import
java.util.ArrayList
;
import
io.github.inflationx.calligraphy3.CalligraphyTypefaceSpan
;
...
...
@@ -26,11 +29,13 @@ import ly.warp.sdk.io.callbacks.CallbackReceiver;
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.LoyaltySDKFirebaseEventModel
;
import
ly.warp.sdk.io.models.SharingCoupon
;
import
ly.warp.sdk.io.models.SharingList
;
import
ly.warp.sdk.io.request.WarplySharingHistoryRequest
;
import
ly.warp.sdk.utils.WarpUtils
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
import
ly.warp.sdk.utils.managers.WarplyEventBusManager
;
import
ly.warp.sdk.utils.managers.WarplyManager
;
import
ly.warp.sdk.views.adapters.ExpiredCouponAdapter
;
import
ly.warp.sdk.views.adapters.SharedCouponAdapter
;
...
...
@@ -54,6 +59,8 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
private
LinearLayout
mLlExpiredTab
,
mLlSharedTab
,
mLlShowMoreExpired
,
mLlShowMoreShared
;
private
RelativeLayout
mRlExpiredView
,
mRlSharedView
;
private
SharingList
mSharedCoupons
=
new
SharingList
();
private
int
mTimer
=
0
;
private
Handler
mSecondsHandler
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -63,6 +70,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_loyalty_analysis
);
mSecondsHandler
=
new
Handler
();
mIvBack
=
findViewById
(
R
.
id
.
iv_loyalty_analysis_close
);
mTvCouponsValueAll
=
findViewById
(
R
.
id
.
tv_expired_coupons_title
);
...
...
@@ -83,6 +91,15 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
@Override
public
void
onResume
()
{
super
.
onResume
();
mTimer
=
0
;
mSecondsHandler
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
mTimer
++;
mSecondsHandler
.
postDelayed
(
this
,
1000
);
}
});
mSharedCoupons
.
clear
();
new
Thread
(()
->
{
...
...
@@ -95,6 +112,25 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
}
@Override
public
void
onPause
()
{
super
.
onPause
();
if
(
mSecondsHandler
!=
null
)
{
mSecondsHandler
.
removeCallbacksAndMessages
(
null
);
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"time_spent_on_loyalty_sdk"
);
analyticsEvent
.
setParameter
(
"name"
,
"GiftsCalculator"
);
analyticsEvent
.
setParameter
(
"seconds"
,
String
.
valueOf
(
mTimer
));
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
}
@Override
public
void
onClick
(
View
view
)
{
if
(
view
.
getId
()
==
R
.
id
.
iv_loyalty_analysis_close
)
{
onBackPressed
();
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
View file @
58fafc4
...
...
@@ -4,6 +4,7 @@ import android.app.Activity;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.text.SpannableStringBuilder
;
import
android.text.Spanned
;
import
android.text.TextUtils
;
...
...
@@ -75,6 +76,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
private
ActiveCouponAdapter
mAdapterCoupons
;
private
AlertDialog
mAlertDialogNonTelco
;
private
ScrollView
mScActiveCodes
,
mSvLoyaltyWallet
;
private
int
mTimer
=
0
;
private
Handler
mSecondsHandler
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -84,6 +87,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_loyalty_wallet
);
mSecondsHandler
=
new
Handler
();
mIvBack
=
findViewById
(
R
.
id
.
iv_back
);
mTvUsername
=
findViewById
(
R
.
id
.
tv_profile_name
);
...
...
@@ -183,8 +187,35 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
}
@Override
public
void
onResume
()
{
super
.
onResume
();
mTimer
=
0
;
mSecondsHandler
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
mTimer
++;
mSecondsHandler
.
postDelayed
(
this
,
1000
);
}
});
}
@Override
public
void
onPause
()
{
super
.
onPause
();
if
(
mSecondsHandler
!=
null
)
{
mSecondsHandler
.
removeCallbacksAndMessages
(
null
);
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"time_spent_on_loyalty_sdk"
);
analyticsEvent
.
setParameter
(
"name"
,
"MyRewards"
);
analyticsEvent
.
setParameter
(
"seconds"
,
String
.
valueOf
(
mTimer
));
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
}
@Override
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MoreForYouActivity.java
View file @
58fafc4
This diff is collapsed. Click to expand it.
warply_android_sdk/src/main/java/ly/warp/sdk/activities/TelcoActivity.java
View file @
58fafc4
...
...
@@ -19,6 +19,7 @@ import com.bumptech.glide.Glide;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.google.android.material.bottomsheet.BottomSheetDialog
;
import
org.greenrobot.eventbus.EventBus
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
...
...
@@ -29,8 +30,10 @@ import ly.warp.sdk.io.callbacks.CallbackReceiver;
import
ly.warp.sdk.io.models.Campaign
;
import
ly.warp.sdk.io.models.Consumer
;
import
ly.warp.sdk.io.models.LoyaltyContextualOfferModel
;
import
ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel
;
import
ly.warp.sdk.io.request.CosmoteSubmitOrderRequest
;
import
ly.warp.sdk.io.request.WarplyConsumerRequest
;
import
ly.warp.sdk.utils.managers.WarplyEventBusManager
;
import
ly.warp.sdk.utils.managers.WarplyManager
;
...
...
@@ -111,12 +114,12 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
if
(
mIsSeeMoreShown
)
{
mTvSeeMoreValue
.
setVisibility
(
View
.
GONE
);
ImageView
seeMoreButtonArrow
=
mLlSeeMore
.
findViewById
(
R
.
id
.
iv_see_more_arrow
);
seeMoreButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
arrow_down_dark
));
seeMoreButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
down_dark_new
));
mIsSeeMoreShown
=
false
;
}
else
{
mTvSeeMoreValue
.
setVisibility
(
View
.
VISIBLE
);
ImageView
seeMoreButtonArrow
=
mLlSeeMore
.
findViewById
(
R
.
id
.
iv_see_more_arrow
);
seeMoreButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
arrow_up_dark
));
seeMoreButtonArrow
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
ic_
up_dark_new
));
mIsSeeMoreShown
=
true
;
}
}
...
...
@@ -266,6 +269,13 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
}
private
void
errorActivatingDialog
()
{
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"loyalty_offer_activated"
);
analyticsEvent
.
setParameter
(
"name"
,
mCCMS
.
getTitle
());
analyticsEvent
.
setParameter
(
"type"
,
"gift"
);
analyticsEvent
.
setParameter
(
"successful"
,
"false"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
mAlertDialogErrorActivating
=
new
AlertDialog
.
Builder
(
this
)
.
setTitle
(
R
.
string
.
cos_dlg_error_title
)
.
setMessage
(
R
.
string
.
cos_dlg_error_subtitle
)
...
...
@@ -276,6 +286,13 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
}
private
void
successActivatingDialog
()
{
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"loyalty_offer_activated"
);
analyticsEvent
.
setParameter
(
"name"
,
mCCMS
.
getTitle
());
analyticsEvent
.
setParameter
(
"type"
,
"gift"
);
analyticsEvent
.
setParameter
(
"successful"
,
"true"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
mAlertDialogSuccessActivating
=
new
AlertDialog
.
Builder
(
this
)
.
setTitle
(
R
.
string
.
cos_dlg_activate_success_title
)
.
setMessage
(
R
.
string
.
cos_dlg_activate_success_subtitle
)
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Coupon.java
View file @
58fafc4
...
...
@@ -63,6 +63,8 @@ public class Coupon implements Parcelable, Serializable {
private
static
final
String
COUPONSET_UUID
=
"couponset_uuid"
;
private
static
final
String
MERCHANT_UUID
=
"merchant_uuid"
;
private
static
final
String
INNER_TEXT
=
"inner_text"
;
private
static
final
String
FINAL_PRICE
=
"final_price"
;
private
static
final
String
DISCOUNT_TYPE
=
"discount_type"
;
/* Member variables of the Campaign object */
...
...
@@ -83,6 +85,8 @@ public class Coupon implements Parcelable, Serializable {
private
String
merchantUuid
=
""
;
private
String
innerText
=
""
;
private
Date
expirationDate
=
new
Date
();
private
String
discount_type
=
""
;
private
double
final_price
=
0.0d
;
/**
* Basic constructor used to create an object from a String, representing a
...
...
@@ -118,6 +122,8 @@ public class Coupon implements Parcelable, Serializable {
this
.
couponsetUuid
=
json
.
optString
(
COUPONSET_UUID
);
this
.
merchantUuid
=
json
.
optString
(
MERCHANT_UUID
);
this
.
innerText
=
json
.
optString
(
INNER_TEXT
);
this
.
discount_type
=
json
.
isNull
(
DISCOUNT_TYPE
)
?
""
:
json
.
optString
(
DISCOUNT_TYPE
);
this
.
final_price
=
json
.
optDouble
(
FINAL_PRICE
);
}
}
...
...
@@ -137,6 +143,8 @@ public class Coupon implements Parcelable, Serializable {
this
.
couponsetUuid
=
source
.
readString
();
this
.
merchantUuid
=
source
.
readString
();
this
.
innerText
=
source
.
readString
();
this
.
discount_type
=
source
.
readString
();
this
.
final_price
=
source
.
readDouble
();
}
@Override
...
...
@@ -156,6 +164,8 @@ public class Coupon implements Parcelable, Serializable {
dest
.
writeString
(
this
.
couponsetUuid
);
dest
.
writeString
(
this
.
merchantUuid
);
dest
.
writeString
(
this
.
innerText
);
dest
.
writeString
(
this
.
discount_type
);
dest
.
writeDouble
(
this
.
final_price
);
}
/**
...
...
@@ -182,6 +192,8 @@ public class Coupon implements Parcelable, Serializable {
jObj
.
putOpt
(
COUPONSET_UUID
,
this
.
couponsetUuid
);
jObj
.
putOpt
(
MERCHANT_UUID
,
this
.
merchantUuid
);
jObj
.
putOpt
(
INNER_TEXT
,
this
.
innerText
);
jObj
.
putOpt
(
DISCOUNT_TYPE
,
this
.
discount_type
);
jObj
.
putOpt
(
FINAL_PRICE
,
this
.
final_price
);
}
catch
(
JSONException
e
)
{
if
(
WarpConstants
.
DEBUG
)
{
e
.
printStackTrace
();
...
...
@@ -357,6 +369,22 @@ public class Coupon implements Parcelable, Serializable {
this
.
expirationDate
=
expirationDate
;
}
public
String
getDiscount_type
()
{
return
discount_type
;
}
public
void
setDiscount_type
(
String
discount_type
)
{
this
.
discount_type
=
discount_type
;
}
public
double
getFinal_price
()
{
return
final_price
;
}
public
void
setFinal_price
(
double
final_price
)
{
this
.
final_price
=
final_price
;
}
@Override
public
int
describeContents
()
{
return
0
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/Couponset.java
View file @
58fafc4
...
...
@@ -74,6 +74,8 @@ public class Couponset implements Parcelable, Serializable {
private
static
final
String
AVAILABILITY
=
"availability"
;
private
static
final
String
MERCHANT_UUID
=
"merchant_uuid"
;
private
static
final
String
INNER_TEXT
=
"inner_text"
;
private
static
final
String
FINAL_PRICE
=
"final_price"
;
private
static
final
String
DISCOUNT_TYPE
=
"discount_type"
;
/* Member variables of the Campaign object */
...
...
@@ -104,6 +106,8 @@ public class Couponset implements Parcelable, Serializable {
private
int
availability
=
0
;
private
String
merchantUuid
=
""
;
private
String
innerText
=
""
;
private
String
discount_type
=
""
;
private
double
final_price
=
0.0d
;
/**
* Basic constructor used to create an object from a String, representing a
...
...
@@ -156,6 +160,8 @@ public class Couponset implements Parcelable, Serializable {
this
.
availability
=
json
.
optInt
(
AVAILABILITY
);
this
.
merchantUuid
=
json
.
optString
(
MERCHANT_UUID
);
this
.
innerText
=
json
.
optString
(
INNER_TEXT
);
this
.
discount_type
=
json
.
isNull
(
DISCOUNT_TYPE
)
?
""
:
json
.
optString
(
DISCOUNT_TYPE
);
this
.
final_price
=
json
.
isNull
(
FINAL_PRICE
)
?
0.0d
:
json
.
optDouble
(
FINAL_PRICE
);
}
}
...
...
@@ -184,6 +190,8 @@ public class Couponset implements Parcelable, Serializable {
this
.
availability
=
source
.
readInt
();
this
.
merchantUuid
=
source
.
readString
();
this
.
innerText
=
source
.
readString
();
this
.
discount_type
=
source
.
readString
();
this
.
final_price
=
source
.
readDouble
();
}
@Override
...
...
@@ -212,6 +220,8 @@ public class Couponset implements Parcelable, Serializable {
dest
.
writeInt
(
this
.
availability
);
dest
.
writeString
(
this
.
merchantUuid
);
dest
.
writeString
(
this
.
innerText
);
dest
.
writeString
(
this
.
discount_type
);
dest
.
writeDouble
(
this
.
final_price
);
}
/**
...
...
@@ -248,6 +258,8 @@ public class Couponset implements Parcelable, Serializable {
jObj
.
putOpt
(
AVAILABILITY
,
this
.
availability
);
jObj
.
putOpt
(
MERCHANT_UUID
,
this
.
merchantUuid
);
jObj
.
putOpt
(
INNER_TEXT
,
this
.
innerText
);
jObj
.
putOpt
(
DISCOUNT_TYPE
,
this
.
discount_type
);
jObj
.
putOpt
(
FINAL_PRICE
,
this
.
final_price
);
}
catch
(
JSONException
e
)
{
if
(
WarpConstants
.
DEBUG
)
{
e
.
printStackTrace
();
...
...
@@ -391,6 +403,14 @@ public class Couponset implements Parcelable, Serializable {
return
innerText
;
}
public
String
getDiscount_type
()
{
return
discount_type
;
}
public
double
getFinal_price
()
{
return
final_price
;
}
@Override
public
int
describeContents
()
{
return
0
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/services/WarplyHealthService.java
View file @
58fafc4
package
ly
.
warp
.
sdk
.
services
;
import
android.app.AlarmManager
;
import
android.app.Notification
;
import
android.app.NotificationChannel
;
import
android.app.NotificationManager
;
...
...
@@ -14,6 +15,7 @@ import android.hardware.SensorEventListener;
import
android.hardware.SensorManager
;
import
android.os.Build
;
import
android.os.IBinder
;
import
android.os.SystemClock
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.RequiresApi
;
...
...
@@ -104,8 +106,9 @@ public class WarplyHealthService extends Service implements SensorEventListener
// b.setContentText(getString(R.string.cos_steps_for_good_notification_subtitle));
b
.
setStyle
(
new
NotificationCompat
.
BigTextStyle
().
bigText
(
getString
(
R
.
string
.
cos_steps_for_good_notification_subtitle
)));
b
.
setContentIntent
(
pbIntent
);
b
.
setAutoCancel
(
tru
e
);
b
.
setAutoCancel
(
fals
e
);
b
.
setOngoing
(
true
);
b
.
setCategory
(
Notification
.
CATEGORY_SERVICE
);
b
.
setSmallIcon
(
R
.
drawable
.
ic_launcher
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
&&
notificationManager
!=
null
)
{
NotificationChannel
notificationChannel
=
new
NotificationChannel
(
STEPS_CHANNEL_ID
,
"steps_notification_channel"
,
NotificationManager
.
IMPORTANCE_DEFAULT
);
...
...
@@ -147,6 +150,22 @@ public class WarplyHealthService extends Service implements SensorEventListener
sendSteps
();
}
// @Override
// public void onTaskRemoved(Intent rootIntent) {
// Intent restartServiceIntent = new Intent(getApplicationContext(), WarplyHealthService.class);
// restartServiceIntent.setPackage(getPackageName());
//
// PendingIntent restartServicePendingIntent = PendingIntent.getService(getApplicationContext(), 2002, restartServiceIntent, PendingIntent.FLAG_ONE_SHOT);
// AlarmManager alarmService = (AlarmManager) getApplicationContext().getSystemService(Context.ALARM_SERVICE);
// alarmService.set(
// AlarmManager.ELAPSED_REALTIME,
// SystemClock.elapsedRealtime() + 1000,
// restartServicePendingIntent
// );
//
// super.onTaskRemoved(rootIntent);
// }
@Nullable
@Override
public
IBinder
onBind
(
Intent
intent
)
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
58fafc4
...
...
@@ -750,6 +750,12 @@ public class WarplyManagerHelper {
}
}
else
if
(
extraFields
.
has
(
"type"
)
&&
extraFields
.
optString
(
"type"
).
equals
(
"telco"
))
{
if
(
item
.
getLoyaltyCampaignId
().
equals
(
camp
.
getSessionUUID
()))
{
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"loyalty_sdk_offer_selected"
);
analyticsEvent
.
setParameter
(
"name"
,
item
.
getTitle
());
analyticsEvent
.
setParameter
(
"type"
,
"gift"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
WarplyManager
.
getSingleCampaign
(
camp
.
getSessionUUID
());
Intent
intent
=
new
Intent
(
context
,
TelcoActivity
.
class
);
intent
.
putExtra
(
"ccms"
,
item
);
...
...
@@ -979,55 +985,57 @@ public class WarplyManagerHelper {
}
public
static
void
setTrackersEnabled
(
boolean
isEnabled
)
{
JSONObject
obj
=
new
JSONObject
();
try
{
obj
.
putOpt
(
"trackers_enabled"
,
isEnabled
);
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
WarplyManager
.
editConsumer
(
new
WarplyEditConsumerRequest
()
.
setHasProfileMetadata
(
true
)
.
setProfileMetadata
(
obj
),
new
CallbackReceiver
<
JSONObject
>()
{
@Override
public
void
onSuccess
(
JSONObject
result
)
{
WarpUtils
.
log
(
"EDIT CONSUMER SUCCESS"
);
WarplyManager
.
getConsumer
(
new
WarplyConsumerRequest
(),
new
CallbackReceiver
<
Consumer
>()
{
@Override
public
void
onSuccess
(
Consumer
result
)
{
WarplyManagerHelper
.
setConsumerInternal
(
result
);
if
(
result
!=
null
)
{
JSONObject
profMetadata
=
WarpJSONParser
.
getJSONFromString
(
result
.
getProfileMetadata
());
if
(
profMetadata
!=
null
&&
profMetadata
.
has
(
"nonTelco"
))
{
WarpUtils
.
setUserNonTelco
(
Warply
.
getWarplyContext
(),
profMetadata
.
optBoolean
(
"nonTelco"
));
}
else
{
WarpUtils
.
setUserNonTelco
(
Warply
.
getWarplyContext
(),
false
);
}
}
if
(
result
!=
null
)
{
JSONObject
profMetadata
=
WarpJSONParser
.
getJSONFromString
(
result
.
getProfileMetadata
());
if
(
profMetadata
!=
null
)
{
if
(
profMetadata
.
has
(
"badge"
))
{
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
profMetadata
.
optString
(
"badge"
));
}
}
}
}
// WarpUtils.setTrackersEnabled();
@Override
public
void
onFailure
(
int
errorCode
)
{
}
});
}
@Override
public
void
onFailure
(
int
errorCode
)
{
WarpUtils
.
log
(
"EDIT CONSUMER FAILED"
);
}
});
// JSONObject obj = new JSONObject();
// try {
// obj.putOpt("trackers_enabled", isEnabled);
// } catch (JSONException e) {
// e.printStackTrace();
// }
//
// WarplyManager.editConsumer(new WarplyEditConsumerRequest()
// .setHasProfileMetadata(true)
// .setProfileMetadata(obj), new CallbackReceiver<JSONObject>() {
// @Override
// public void onSuccess(JSONObject result) {
// WarpUtils.log("EDIT CONSUMER SUCCESS");
// WarplyManager.getConsumer(new WarplyConsumerRequest(), new CallbackReceiver<Consumer>() {
// @Override
// public void onSuccess(Consumer result) {
// WarplyManagerHelper.setConsumerInternal(result);
//
// if (result != null) {
// JSONObject profMetadata = WarpJSONParser.getJSONFromString(result.getProfileMetadata());
// if (profMetadata != null && profMetadata.has("nonTelco")) {
// WarpUtils.setUserNonTelco(Warply.getWarplyContext(), profMetadata.optBoolean("nonTelco"));
// } else {
// WarpUtils.setUserNonTelco(Warply.getWarplyContext(), false);
// }
// }
//
// if (result != null) {
// JSONObject profMetadata = WarpJSONParser.getJSONFromString(result.getProfileMetadata());
// if (profMetadata != null) {
// if (profMetadata.has("badge")) {
// WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge"));
// }
// }
// }
// }
//
// @Override
// public void onFailure(int errorCode) {
//
// }
// });
// }
//
// @Override
// public void onFailure(int errorCode) {
// WarpUtils.log("EDIT CONSUMER FAILED");
// }
// });
}
/**
...
...
@@ -1174,7 +1182,8 @@ public class WarplyManagerHelper {
cpnlistExpired
.
add
(
coupon
);
try
{
couponCount
+=
1
;
couponValue
+=
Float
.
parseFloat
(
coupon
.
getDiscount
());
// couponValue += Float.parseFloat(coupon.getDiscount());
couponValue
+=
(
float
)
coupon
.
getFinal_price
();
}
catch
(
NumberFormatException
e
)
{
couponCount
-=
1
;
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
58fafc4
...
...
@@ -25,7 +25,10 @@
package
ly
.
warp
.
sdk
.
utils
.
managers
;
import
android.app.ActivityManager
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.util.Log
;
...
...
@@ -91,6 +94,7 @@ import ly.warp.sdk.io.models.SharingList;
import
ly.warp.sdk.io.models.TagsCategoriesList
;
import
ly.warp.sdk.io.models.TagsList
;
import
ly.warp.sdk.io.models.TransactionsList
;
import
ly.warp.sdk.io.models.WarplyPacingEventModel
;
import
ly.warp.sdk.io.request.CosmoteCouponSharingRequest
;
import
ly.warp.sdk.io.request.CosmotePostEventRequest
;
import
ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest
;
...
...
@@ -138,6 +142,7 @@ import ly.warp.sdk.io.request.WarplyValidateCouponRequest;
import
ly.warp.sdk.io.request.WarplyVerifyOTPRequest
;
import
ly.warp.sdk.io.request.WarplyVerifyTicketRequest
;
import
ly.warp.sdk.services.EventCampaignService
;
import
ly.warp.sdk.services.WarplyHealthService
;
import
ly.warp.sdk.utils.WarpJSONParser
;
import
ly.warp.sdk.utils.WarpUtils
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
...
...
@@ -836,6 +841,21 @@ public class WarplyManager {
if
(
profMetadata
.
has
(
"badge"
))
{
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
profMetadata
.
optString
(
"badge"
));
}
if
(
profMetadata
.
has
(
"steps_enabled"
)
&&
profMetadata
.
optBoolean
(
"steps_enabled"
))
{
if
(!
isMyServiceRunning
(
WarplyHealthService
.
class
))
{
Intent
stepsServiceIntent
=
new
Intent
(
Warply
.
getWarplyContext
(),
WarplyHealthService
.
class
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
Warply
.
getWarplyContext
().
startForegroundService
(
stepsServiceIntent
);
}
else
{
Warply
.
getWarplyContext
().
startService
(
stepsServiceIntent
);
}
WarplyPacingEventModel
pacingVisible
=
new
WarplyPacingEventModel
();
pacingVisible
.
setVisible
(
true
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
pacingVisible
));
}
}
}
}
}
...
...
@@ -2288,6 +2308,8 @@ public class WarplyManager {
coupon
.
setName
(
couponset
.
getName
());
coupon
.
setMerchantUuid
(
couponset
.
getMerchantUuid
());
coupon
.
setInnerText
(
couponset
.
getInnerText
());
coupon
.
setDiscount_type
(
couponset
.
getDiscount_type
());
coupon
.
setFinal_price
(
couponset
.
getFinal_price
());
mCouponList
.
add
(
coupon
);
}
}
...
...
@@ -2405,6 +2427,21 @@ public class WarplyManager {
if
(
profMetadata
.
has
(
"badge"
))
{
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
profMetadata
.
optString
(
"badge"
));
}
if
(
profMetadata
.
has
(
"steps_enabled"
)
&&
profMetadata
.
optBoolean
(
"steps_enabled"
))
{
if
(!
isMyServiceRunning
(
WarplyHealthService
.
class
))
{
Intent
stepsServiceIntent
=
new
Intent
(
Warply
.
getWarplyContext
(),
WarplyHealthService
.
class
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
Warply
.
getWarplyContext
().
startForegroundService
(
stepsServiceIntent
);
}
else
{
Warply
.
getWarplyContext
().
startService
(
stepsServiceIntent
);
}
WarplyPacingEventModel
pacingVisible
=
new
WarplyPacingEventModel
();
pacingVisible
.
setVisible
(
true
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
pacingVisible
));
}
}
}
}
}
...
...
@@ -2622,4 +2659,14 @@ public class WarplyManager {
}
},
null
);
}
private
static
boolean
isMyServiceRunning
(
Class
<?>
serviceClass
)
{
ActivityManager
manager
=
(
ActivityManager
)
Warply
.
getWarplyContext
().
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
for
(
ActivityManager
.
RunningServiceInfo
service
:
manager
.
getRunningServices
(
Integer
.
MAX_VALUE
))
{
if
(
serviceClass
.
getName
().
equals
(
service
.
service
.
getClassName
()))
{
return
true
;
}
}
return
false
;
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
View file @
58fafc4
...
...
@@ -437,7 +437,12 @@ public class WarpView extends WebView {
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
Intent
stepsServiceIntent
=
new
Intent
(
Warply
.
getWarplyContext
(),
WarplyHealthService
.
class
);
// Warply.getWarplyContext().startService(stepsServiceIntent);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
Warply
.
getWarplyContext
().
startForegroundService
(
stepsServiceIntent
);
}
else
{
Warply
.
getWarplyContext
().
startService
(
stepsServiceIntent
);
}
WarplyPacingEventModel
pacingVisible
=
new
WarplyPacingEventModel
();
pacingVisible
.
setVisible
(
true
);
...
...
@@ -454,6 +459,51 @@ public class WarpView extends WebView {
WarpUtils
.
log
(
"**************** WARPLY Webview Log START *****************"
);
WarpUtils
.
log
(
message
);
WarpUtils
.
log
(
"**************** WARPLY Webview Log END *****************"
);
}
else
if
(
parts
[
1
].
equals
(
"loyalty_questionnaire_selected"
))
{
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
parts
[
1
]);
analyticsEvent
.
setParameter
(
"completed"
,
"true"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
else
if
(
parts
[
1
].
equals
(
"loyalty_questionnaire_answer_again"
)
||
parts
[
1
].
equals
(
"loyalty_questionnaire_answers_deleted"
))
{
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
parts
[
1
]);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
else
if
(
parts
[
1
].
equals
(
"loyalty_questionnaire_later"
))
{
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"loyalty_questionnaire_selected"
);
analyticsEvent
.
setParameter
(
"completed"
,
"false"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
else
if
(
parts
[
1
].
equals
(
"loyalty_sdk_offer_selected"
))
{
try
{
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"loyalty_sdk_offer_selected"
);
analyticsEvent
.
setParameter
(
"name"
,
parts
[
2
]);
analyticsEvent
.
setParameter
(
"type"
,
parts
[
3
]);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
if
(
parts
[
1
].
equals
(
"loyalty_offer_activated"
))
{
try
{
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"loyalty_sdk_offer_selected"
);
analyticsEvent
.
setParameter
(
"name"
,
parts
[
2
]);
analyticsEvent
.
setParameter
(
"type"
,
parts
[
3
]);
analyticsEvent
.
setParameter
(
"successful"
,
parts
[
4
]);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
if
(
parts
[
1
].
equals
(
"time_spent_on_loyalty_sdk"
))
{
try
{
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"time_spent_on_loyalty_sdk"
);
analyticsEvent
.
setParameter
(
"name"
,
parts
[
2
]);
analyticsEvent
.
setParameter
(
"seconds"
,
parts
[
3
]);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/ActiveCouponAdapter.java
View file @
58fafc4
...
...
@@ -174,7 +174,19 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
else
holder
.
tvCouponDate
.
setText
(
String
.
format
(
mContext
.
getString
(
R
.
string
.
cos_coupon_date
),
simpleDateFormat
.
format
(
newDate
!=
null
?
newDate
:
""
)));
if
(
TextUtils
.
isEmpty
(
couponItem
.
getDiscount_type
()))
{
holder
.
tvCouponValue
.
setText
(
couponItem
.
getDiscount
()
+
mContext
.
getResources
().
getString
(
R
.
string
.
euro
));
}
else
{
if
(
couponItem
.
getDiscount_type
().
equals
(
"value"
))
{
holder
.
tvCouponValue
.
setText
(
couponItem
.
getDiscount
()
+
mContext
.
getResources
().
getString
(
R
.
string
.
euro
));
}
else
if
(
couponItem
.
getDiscount_type
().
equals
(
"percentage"
))
{
holder
.
tvCouponValue
.
setText
(
couponItem
.
getDiscount
()
+
mContext
.
getResources
().
getString
(
R
.
string
.
percentage
));
}
else
if
(
couponItem
.
getDiscount_type
().
equals
(
"plus_one"
))
{
holder
.
tvCouponValue
.
setText
(
couponItem
.
getDiscount
()
+
mContext
.
getResources
().
getString
(
R
.
string
.
plus_one
));
}
else
{
holder
.
tvCouponValue
.
setText
(
couponItem
.
getDiscount
()
+
mContext
.
getResources
().
getString
(
R
.
string
.
euro
));
}
}
holder
.
itemView
.
setOnClickListener
(
v
->
onClickSubject
.
onNext
(
couponItem
));
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MergedGiftsAdapter.java
View file @
58fafc4
...
...
@@ -67,8 +67,7 @@ public class MergedGiftsAdapter extends RecyclerView.Adapter<MergedGiftsAdapter.
@Override
public
long
getItemId
(
int
position
)
{
// return super.getItemId(position);
return
Double
.
valueOf
(
Math
.
random
()).
longValue
();
return
super
.
getItemId
(
position
);
}
public
MergedGifts
getItem
(
int
id
)
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/adapters/MoreContextualAdapter.java
View file @
58fafc4
...
...
@@ -59,8 +59,7 @@ public class MoreContextualAdapter extends RecyclerView.Adapter<MoreContextualAd
@Override
public
long
getItemId
(
int
position
)
{
// return super.getItemId(position);
return
Double
.
valueOf
(
Math
.
random
()).
longValue
();
return
super
.
getItemId
(
position
);
}
public
LoyaltyContextualOfferModel
getItem
(
int
id
)
{
...
...
warply_android_sdk/src/main/res/drawable-xhdpi/ic_coupon_background_new.png
0 → 100644
View file @
58fafc4
2.58 KB
warply_android_sdk/src/main/res/drawable-xhdpi/ic_down_dark_new.png
0 → 100644
View file @
58fafc4
972 Bytes
warply_android_sdk/src/main/res/drawable-xhdpi/ic_up_dark_new.png
0 → 100644
View file @
58fafc4
935 Bytes
warply_android_sdk/src/main/res/layout/active_coupon_layout.xml
View file @
58fafc4
...
...
@@ -3,8 +3,10 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"140dp"
android:background=
"@drawable/ic_coupon_background"
>
android:layout_height=
"130dp"
android:layout_marginVertical=
"4dp"
android:layout_marginHorizontal=
"4dp"
android:background=
"@drawable/ic_coupon_background_new"
>
<androidx.constraintlayout.widget.Guideline
android:id=
"@+id/gl_vertical_72_percent"
...
...
@@ -79,7 +81,7 @@
android:id=
"@+id/tv_active_coupons_description"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"
24
dp"
android:layout_marginStart=
"
8
dp"
android:layout_marginEnd=
"32dp"
fontPath=
"fonts/pf_square_sans_pro_medium.ttf"
android:maxLines=
"4"
...
...
warply_android_sdk/src/main/res/layout/activity_coupon_info.xml
View file @
58fafc4
...
...
@@ -222,7 +222,7 @@
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:layout_marginStart=
"6dp"
android:src=
"@drawable/ic_down_dark"
/>
android:src=
"@drawable/ic_down_dark
_new
"
/>
</LinearLayout>
</LinearLayout>
...
...
@@ -309,7 +309,7 @@
fontPath=
"fonts/pf_square_sans_pro_regular.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
Όροι χρήσης
"
android:text=
"
@string/cos_coupon_terms_title
"
android:textColor=
"@color/grey"
android:textSize=
"16sp"
/>
...
...
@@ -318,7 +318,7 @@
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:layout_marginStart=
"6dp"
android:src=
"@drawable/ic_down_dark"
/>
android:src=
"@drawable/ic_down_dark
_new
"
/>
</LinearLayout>
<TextView
...
...
warply_android_sdk/src/main/res/layout/activity_coupon_share.xml
View file @
58fafc4
...
...
@@ -133,7 +133,7 @@
android:layout_height=
"16dp"
android:layout_alignParentEnd=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_
arrow_down_dark
"
/>
android:src=
"@drawable/ic_
down_dark_new
"
/>
</RelativeLayout>
<View
...
...
warply_android_sdk/src/main/res/layout/activity_couponset_info.xml
View file @
58fafc4
...
...
@@ -153,8 +153,8 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/cos_coupon_terms_title"
android:textColor=
"
#415564
"
android:textSize=
"1
5
sp"
/>
android:textColor=
"
@color/grey
"
android:textSize=
"1
6
sp"
/>
<ImageView
android:id=
"@+id/iv_terms_arrow"
...
...
@@ -162,7 +162,7 @@
android:layout_height=
"14dp"
android:layout_marginStart=
"6dp"
android:layout_marginTop=
"2dp"
android:src=
"@drawable/ic_down_dark"
/>
android:src=
"@drawable/ic_down_dark
_new
"
/>
</LinearLayout>
<TextView
...
...
@@ -172,6 +172,7 @@
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/ll_terms_inner"
android:layout_marginTop=
"16dp"
android:layout_marginHorizontal=
"64dp"
android:textColor=
"@color/grey"
android:visibility=
"gone"
tools:text=
"@string/cos_coupon_date"
...
...
warply_android_sdk/src/main/res/layout/activity_telco.xml
View file @
58fafc4
...
...
@@ -207,7 +207,7 @@
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:layout_marginStart=
"6dp"
android:src=
"@drawable/ic_down_dark"
/>
android:src=
"@drawable/ic_down_dark
_new
"
/>
</LinearLayout>
<TextView
...
...
warply_android_sdk/src/main/res/values/strings.xml
View file @
58fafc4
...
...
@@ -58,6 +58,8 @@
<string
name=
"cos_annual"
>
12Μηνο
</string>
<string
name=
"cos_analysis2"
>
Αναλυτικά:
</string>
<string
name=
"euro"
>
€
</string>
<string
name=
"percentage"
>
%
</string>
<string
name=
"plus_one"
>
1+1
</string>
<string
name=
"cos_profile_questionnaire"
>
Ερωτηματολόγιο
</string>
<string
name=
"cos_active_all_coupons"
>
Ενεργά κουπόνια
</string>
<string
name=
"cos_active_all_rewards"
>
Όλα τα δώρα μου
</string>
...
...
@@ -140,6 +142,8 @@
<string
name=
"cos_comma"
>
,
</string>
<string
name=
"cos_dlg_non_telco_title"
>
Αδυναμία ενεργοποίησης
</string>
<string
name=
"cos_share_no_assets"
>
Για την αποστολή του δώρου σου χρειάζεται να έχεις κινητό COSMOTE.
</string>
<string
name=
"cos_dlg_coupon_depleted_title"
>
H προσφορά δεν είναι πλέον διαθέσιμη
</string>
<string
name=
"cos_dlg_coupon_depleted_message"
>
Μείνε συντονισμένος για νέες προσφορές και κουπόνια.
</string>
<string-array
name=
"coupons_array"
>
<item>
Κουπόνια
</item>
...
...
Please
register
or
login
to post a comment