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
2023-10-24 14:33:53 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9ce62f8287e4d9e18cc4ff3751ff6dd534539b7b
9ce62f82
1 parent
bdf378e4
vouchers part3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
17 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
warply_android_sdk/src/main/res/layout/activity_loyalty_wallet.xml
warply_android_sdk/src/main/res/values/styles.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
View file @
9ce62f8
...
...
@@ -82,7 +82,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
private
ConstraintLayout
mClDealsBanner
,
mClDealsView
,
mClGiftsBanner
,
mClToolbar
,
mClMarket
;
private
LinearLayout
mLlQuestionnaire
,
mLlUserBadge
,
mLlEmptyWallet
,
mLlDeals
,
mLlGifts
,
mLlMarketView
,
mLlHistory
,
mLlBannerInfo
,
mLlVouchers
;
mLlMarketView
,
mLlHistory
,
mLlBannerInfo
,
mLlVouchers
,
mLlVouchersSpinner
;
private
FlowLayout
mLlActiveCodesView
;
private
float
couponDfyValue
=
0.0f
,
mFavValue
=
0.0f
;
private
RecyclerView
mRecyclerCoupons
,
mRvMarketCoupons
;
...
...
@@ -162,6 +162,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mRecyclerCoupons
=
findViewById
(
R
.
id
.
rv_active_coupons
);
mCvVouchers
=
findViewById
(
R
.
id
.
cv_vouchers
);
mLlVouchers
=
findViewById
(
R
.
id
.
ll_vouchers
);
mLlVouchersSpinner
=
findViewById
(
R
.
id
.
ll_vouchers_spinner
);
/** Deals Badge */
// if (WarplyManagerHelper.getActiveDFYCoupons() != null) {
...
...
@@ -254,7 +255,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
cl_deals_win_inner_cos
||
view
.
getId
()
==
R
.
id
.
rv_deals_count
)
{
/** Deals History */
if
(
view
.
getId
()
==
R
.
id
.
cl_deals_win_inner_cos
)
{
if
(!
mDealsBannerPressed
)
{
mDealsBannerPressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
...
...
@@ -272,15 +274,21 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
return
;
}
/** Active Unified Banner */
if
(
view
.
getId
()
==
R
.
id
.
rv_sm_count
)
{
if
(!
mUnifiedCountPressed
)
{
mUnifiedCountPressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"SMDealsBanner"
));
.
concat
(
"ActiveMarketBanner"
));
// LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
// analyticsEvent.setEventName("did_tap_sm_deals_badge");
// analyticsEvent.setParameter("screen", "Loyalty Wallet");
// EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_
sm_deals
_badge"
);
analyticsEvent
.
setEventName
(
"did_tap_
market_active
_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
...
...
@@ -289,15 +297,21 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
return
;
}
/** Active Coupons Banner */
if
(
view
.
getId
()
==
R
.
id
.
rv_gifts_count
)
{
if
(!
mGiftsCountPressed
)
{
mGiftsCountPressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"GFYBanner"
));
.
concat
(
"ActiveLoyaltyBanner"
));
// LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
// analyticsEvent.setEventName("did_tap_gifts_badge");
// analyticsEvent.setParameter("screen", "Loyalty Wallet");
// EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_gifts_badge"
);
analyticsEvent
.
setEventName
(
"did_tap_gifts_
for_you_active_
badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
...
...
@@ -306,6 +320,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
return
;
}
/** Coupons History */
if
(
view
.
getId
()
==
R
.
id
.
cl_deals_win_inner
)
{
if
(!
mHistoryPressed
)
{
mHistoryPressed
=
true
;
...
...
@@ -334,23 +349,25 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
return
;
}
/** Unified History */
if
(
view
.
getId
()
==
R
.
id
.
cl_market_inner
)
{
// if (countValue > 0) {
if
(!
mHistoryMarketPressed
)
{
mHistoryMarketPressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"MarketBanner"
));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_market_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
Intent
intent
=
new
Intent
(
LoyaltyWallet
.
this
,
LoyaltyMarketAnalysisActivity
.
class
);
startActivity
(
intent
);
}
// }
return
;
}
/** New History */
if
(
view
.
getId
()
==
R
.
id
.
ll_loyalty_history
)
{
if
(!
mHistoryBadgePressed
)
{
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
...
...
@@ -361,9 +378,12 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
analyticsEvent
.
setEventName
(
"did_tap_history_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
//TODO: add new history intent
}
return
;
}
/** Vouchers Client's Screen */
if
(
view
.
getId
()
==
R
.
id
.
cv_vouchers
)
{
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
...
...
@@ -378,13 +398,19 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
vouchersActivity
));
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
cl_mygifts
)
{
/** Active Deals Banner */
if
(
view
.
getId
()
==
R
.
id
.
cl_mygifts
||
view
.
getId
()
==
R
.
id
.
rv_deals_count
)
{
if
(!
mDfyPressed
)
{
mDfyPressed
=
true
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"click"
,
(
"LoyaltyWalletScreen"
)
.
concat
(
":"
)
.
concat
(
"ActiveDealsBanner"
));
LoyaltySDKFirebaseEventModel
analyticsEvent
=
new
LoyaltySDKFirebaseEventModel
();
analyticsEvent
.
setEventName
(
"did_tap_deals_for_you_active_badge"
);
analyticsEvent
.
setParameter
(
"screen"
,
"Loyalty Wallet"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
analyticsEvent
));
ActiveDFYCouponEventModel
activeCouponEventModel
=
new
ActiveDFYCouponEventModel
();
activeCouponEventModel
.
setPressed
(
true
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
activeCouponEventModel
));
...
...
@@ -425,13 +451,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
public
void
onMessageEvent
(
WarplyEventBusManager
event
)
{
if
(
event
.
getVouchersFetched
()
!=
null
)
{
if
(
WarplyManagerHelper
.
getShowVouchersBanner
().
equals
(
"true"
))
{
//TODO: hide spinner
runOnUiThread
(()
->
{
mLlVouchersSpinner
.
setVisibility
(
View
.
GONE
);
mLlVouchers
.
setVisibility
(
View
.
VISIBLE
);
});
}
else
{
//.equals("false)
//TODO: hide spinner
runOnUiThread
(()
->
{
mLlVouchersSpinner
.
setVisibility
(
View
.
GONE
);
});
}
return
;
}
...
...
@@ -968,10 +995,20 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
private
void
checkForEmpty
()
{
if
((
WarplyManagerHelper
.
getActiveDFYCoupons
()
!=
null
&&
WarplyManagerHelper
.
getActiveDFYCoupons
().
size
()
==
0
)
&&
(
WarplyManagerHelper
.
getMarketCouponsList
()
!=
null
&&
WarplyManagerHelper
.
getMarketCouponsList
().
size
()
==
0
)
&&
(
WarplyManagerHelper
.
getCouponList
()
!=
null
&&
WarplyManagerHelper
.
getCouponList
().
size
()
==
0
)
&&
(
TextUtils
.
isEmpty
(
WarplyManagerHelper
.
getShowVouchersBanner
())))
{
mLlEmptyWallet
.
setVisibility
(
View
.
VISIBLE
);
//TODO: check for spinner and show it
&&
(
WarplyManagerHelper
.
getCouponList
()
!=
null
&&
WarplyManagerHelper
.
getCouponList
().
size
()
==
0
))
{
if
(
TextUtils
.
isEmpty
(
WarplyManagerHelper
.
getShowVouchersBanner
()))
{
mLlBannerInfo
.
setVisibility
(
View
.
VISIBLE
);
mLlVouchersSpinner
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
WarplyManagerHelper
.
getShowVouchersBanner
().
equals
(
"true"
))
{
mLlBannerInfo
.
setVisibility
(
View
.
VISIBLE
);
mLlVouchersSpinner
.
setVisibility
(
View
.
GONE
);
mLlVouchers
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
WarplyManagerHelper
.
getShowVouchersBanner
().
equals
(
"false"
))
{
mLlBannerInfo
.
setVisibility
(
View
.
GONE
);
mLlVouchersSpinner
.
setVisibility
(
View
.
GONE
);
mLlVouchers
.
setVisibility
(
View
.
GONE
);
mLlEmptyWallet
.
setVisibility
(
View
.
VISIBLE
);
}
}
else
{
mLlEmptyWallet
.
setVisibility
(
View
.
GONE
);
if
((
WarplyManagerHelper
.
getActiveDFYCoupons
()
!=
null
&&
WarplyManagerHelper
.
getActiveDFYCoupons
().
size
()
>
0
)
...
...
@@ -979,8 +1016,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
||
(
WarplyManagerHelper
.
getCouponList
()
!=
null
&&
WarplyManagerHelper
.
getCouponList
().
size
()
>
0
))
{
mLlBannerInfo
.
setVisibility
(
View
.
VISIBLE
);
}
if
(
WarplyManagerHelper
.
getShowVouchersBanner
().
equals
(
"true"
))
{
if
(
TextUtils
.
isEmpty
(
WarplyManagerHelper
.
getShowVouchersBanner
()))
{
mLlVouchersSpinner
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
WarplyManagerHelper
.
getShowVouchersBanner
().
equals
(
"true"
))
{
mLlVouchersSpinner
.
setVisibility
(
View
.
GONE
);
mLlVouchers
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
WarplyManagerHelper
.
getShowVouchersBanner
().
equals
(
"false"
))
{
mLlVouchersSpinner
.
setVisibility
(
View
.
GONE
);
mLlVouchers
.
setVisibility
(
View
.
GONE
);
}
}
}
...
...
warply_android_sdk/src/main/res/layout/activity_loyalty_wallet.xml
View file @
9ce62f8
...
...
@@ -467,6 +467,22 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id=
"@+id/ll_vouchers_spinner"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"32dp"
android:orientation=
"vertical"
android:gravity=
"center_horizontal"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<ProgressBar
android:id=
"@+id/pb_vouchers"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:theme=
"@style/progressBarGreen"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_vouchers"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
warply_android_sdk/src/main/res/values/styles.xml
View file @
9ce62f8
...
...
@@ -68,4 +68,8 @@
<item
name=
"cornerSizeBottomRight"
>
0dp
</item>
</style>
<style
name=
"progressBarGreen"
parent=
"@style/Theme.AppCompat"
>
<item
name=
"colorAccent"
>
@color/cos_green12
</item>
</style>
</resources>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment