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
2024-11-01 13:58:51 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b43f6b7e5ac607a3c04440d471786df36dc470e8
b43f6b7e
1 parent
a0e06b93
more fixes and additions
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
116 additions
and
8 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/ActiveUnifiedCouponsActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/ContextualActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponShareActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponsetInfoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/TelcoActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/UnifiedCouponInfoActivity.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_telco.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/ActiveUnifiedCouponsActivity.java
View file @
b43f6b7
...
...
@@ -191,6 +191,8 @@ public class ActiveUnifiedCouponsActivity extends Activity implements View.OnCli
mPbLoading
.
setVisibility
(
View
.
VISIBLE
);
WarplyManager
.
createUnifiedCoupon
(
tempArray
,
mCreateUnifiedCallback
);
}
else
{
mIsActivatePressed
=
false
;
}
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/ContextualActivity.java
View file @
b43f6b7
...
...
@@ -2,6 +2,7 @@ package ly.warp.sdk.activities;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.util.Log
;
...
...
@@ -190,13 +191,20 @@ public class ContextualActivity extends Activity implements View.OnClickListener
final
BottomSheetDialog
bottomSheetDialog
=
new
BottomSheetDialog
(
this
,
R
.
style
.
BottomSheetDialog
);
bottomSheetDialog
.
setContentView
(
R
.
layout
.
dl_share
);
bottomSheetDialog
.
setOnDismissListener
(
dialog
->
{
mIsActivatePressed
=
false
;
bottomSheetDialog
.
dismiss
();
});
TextView
tvHeader
=
bottomSheetDialog
.
findViewById
(
R
.
id
.
tv_sender_value
);
WarpUtils
.
renderCustomFont
(
this
,
R
.
font
.
bt_cosmo_bold
,
tvHeader
);
tvHeader
.
setText
(
R
.
string
.
cos_coupon_share_telco
);
LinearLayout
parent
=
bottomSheetDialog
.
findViewById
(
R
.
id
.
ll_share_dialog_view_inner
);
ImageView
dialogClose
=
(
ImageView
)
bottomSheetDialog
.
findViewById
(
R
.
id
.
iv_sender_list_close
);
dialogClose
.
setOnClickListener
(
view
->
bottomSheetDialog
.
dismiss
());
dialogClose
.
setOnClickListener
(
view
->
{
mIsActivatePressed
=
false
;
bottomSheetDialog
.
dismiss
();
});
if
(
mCCMS
.
getEligibleAssets
()
!=
null
&&
mCCMS
.
getEligibleAssets
().
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
mCCMS
.
getEligibleAssets
().
size
();
i
++)
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponInfoActivity.java
View file @
b43f6b7
...
...
@@ -325,8 +325,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
final
BottomSheetDialog
bottomSheetDialog
=
new
BottomSheetDialog
(
this
,
R
.
style
.
BottomSheetDialog
);
bottomSheetDialog
.
setContentView
(
R
.
layout
.
dl_bottom_sheet_merchants
);
bottomSheetDialog
.
setOnDismissListener
(
dialog
->
{
bottomSheetDialog
.
dismiss
();
mIsFindItPressed
=
false
;
bottomSheetDialog
.
dismiss
();
});
TextView
sheetTitle
=
bottomSheetDialog
.
findViewById
(
R
.
id
.
tv_sm_sheet_title
);
TextView
sheetSubtitle
=
bottomSheetDialog
.
findViewById
(
R
.
id
.
tv_sm_sheet_subtitle
);
...
...
@@ -336,8 +336,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
ImageView
dialogClose
=
(
ImageView
)
bottomSheetDialog
.
findViewById
(
R
.
id
.
iv_sm_sheet_close
);
dialogClose
.
setOnClickListener
(
view
->
{
bottomSheetDialog
.
dismiss
();
mIsFindItPressed
=
false
;
bottomSheetDialog
.
dismiss
();
});
for
(
int
i
=
0
;
i
<
shopAvailability
.
length
();
i
++)
{
...
...
@@ -374,6 +374,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
.
into
(
merchantLogo
);
ConstraintLayout
buyButton
=
(
ConstraintLayout
)
v
.
findViewById
(
R
.
id
.
cl_button_sm_buy_it
);
buyButton
.
setOnClickListener
(
view
->
{
mIsFindItPressed
=
false
;
bottomSheetDialog
.
dismiss
();
if
(!
TextUtils
.
isEmpty
(
finalProductUrl
))
{
Intent
browserIntent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
finalProductUrl
));
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponShareActivity.java
View file @
b43f6b7
...
...
@@ -64,7 +64,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
private
EditText
mEdtReceiver
;
private
AlertDialog
mAlertDialogSuccessSharing
,
mAlertDialogErrorSharing
,
mAlertDialogCouponAskSharing
,
mAlertDialogWrongNumberSharing
,
mAlertDialogNoAssets
;
private
boolean
mIsFromWallet
=
false
,
mIsActiveUnified
=
false
;
private
boolean
mIsFromWallet
=
false
,
mIsActiveUnified
=
false
,
mIsSharePressed
=
false
;
private
RelativeLayout
mPbLoading
;
// ===========================================================
...
...
@@ -118,6 +118,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
@Override
public
void
onResume
()
{
super
.
onResume
();
mIsSharePressed
=
false
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"screen"
,
"CouponShareScreen"
);
WarplyManager
.
getConsumer
(
new
WarplyConsumerRequest
()
...
...
@@ -162,7 +163,10 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
}
if
(
view
.
getId
()
==
R
.
id
.
ll_share_button
)
{
if
(!
TextUtils
.
isEmpty
(
mSender
)
&&
!
mTvPhoneHeader
.
getText
().
toString
().
equals
(
R
.
string
.
cos_coupon_share_sender
)
&&
!
TextUtils
.
isEmpty
(
mEdtReceiver
.
getText
().
toString
()))
{
if
(!
mIsSharePressed
)
{
mIsSharePressed
=
true
;
askSharingDialog
();
}
}
else
{
errorSharingDialog2
();
}
...
...
@@ -200,6 +204,9 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
private
void
showSharingDialog
()
{
final
BottomSheetDialog
bottomSheetDialog
=
new
BottomSheetDialog
(
this
,
R
.
style
.
BottomSheetDialog
);
bottomSheetDialog
.
setContentView
(
R
.
layout
.
dl_share
);
bottomSheetDialog
.
setOnDismissListener
(
dialog
->
{
bottomSheetDialog
.
dismiss
();
});
LinearLayout
parent
=
bottomSheetDialog
.
findViewById
(
R
.
id
.
ll_share_dialog_view_inner
);
ImageView
dialogClose
=
(
ImageView
)
bottomSheetDialog
.
findViewById
(
R
.
id
.
iv_sender_list_close
);
...
...
@@ -326,6 +333,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
}).
start
();
})
.
setNegativeButton
(
R
.
string
.
cos_dlg_negative_button2
,
(
dialogNegative
,
whichNegative
)
->
{
mIsSharePressed
=
false
;
dialogNegative
.
dismiss
();
})
.
show
();
...
...
@@ -347,6 +355,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
private
final
CallbackReceiver
<
JSONObject
>
mCouponSharingCallback
=
new
CallbackReceiver
<
JSONObject
>()
{
@Override
public
void
onSuccess
(
JSONObject
result
)
{
mIsSharePressed
=
false
;
int
status
=
result
.
optInt
(
"status"
,
2
);
String
message
=
result
.
optString
(
"msg"
,
""
);
if
(
status
==
1
)
{
...
...
@@ -373,6 +382,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
@Override
public
void
onFailure
(
int
errorCode
)
{
mIsSharePressed
=
false
;
Log
.
v
(
"COUPON_SHARE"
,
String
.
valueOf
(
errorCode
));
runOnUiThread
(()
->
{
mPbLoading
.
setVisibility
(
View
.
GONE
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponsetInfoActivity.java
View file @
b43f6b7
...
...
@@ -228,6 +228,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
private
final
CallbackReceiver
<
JSONObject
>
mRedeemCouponCallback
=
new
CallbackReceiver
<
JSONObject
>()
{
@Override
public
void
onSuccess
(
JSONObject
result
)
{
mIsGiftPressed
=
false
;
mPbLoading
.
setVisibility
(
View
.
GONE
);
int
status
=
result
.
optInt
(
"status"
);
if
(
status
==
1
)
{
...
...
@@ -283,6 +284,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
@Override
public
void
onFailure
(
int
errorCode
)
{
mIsGiftPressed
=
false
;
mPbLoading
.
setVisibility
(
View
.
GONE
);
showDialog
(
false
,
errorCode
);
mLlRedeem
.
setEnabled
(
true
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/TelcoActivity.java
View file @
b43f6b7
...
...
@@ -2,6 +2,7 @@ package ly.warp.sdk.activities;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.util.Log
;
...
...
@@ -10,6 +11,7 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
androidx.appcompat.app.AlertDialog
;
...
...
@@ -59,7 +61,8 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
private
String
mSender
=
""
;
private
AlertDialog
mAlertDialogAskActivate
,
mAlertDialogErrorActivating
,
mAlertDialogSuccessActivating
;
private
LinearLayout
mLlSeeMore
;
private
boolean
mIsSeeMoreShown
=
false
;
private
boolean
mIsSeeMoreShown
=
false
,
mIsActivatePressed
=
false
;
private
RelativeLayout
mPbLoading
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -92,6 +95,8 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
mTvSeeMoreValue
=
findViewById
(
R
.
id
.
tv_see_more_value
);
mFontButtonGetIt
=
findViewById
(
R
.
id
.
button_get_it
);
mFontButtonSeeMore
=
findViewById
(
R
.
id
.
tv_see_more
);
mPbLoading
=
findViewById
(
R
.
id
.
pb_loading
);
mPbLoading
.
setOnTouchListener
((
v
,
event
)
->
true
);
WarpUtils
.
renderCustomFont
(
this
,
R
.
font
.
bt_cosmo_bold
,
mTvTelcoHeaderTitle
);
WarpUtils
.
renderCustomFont
(
this
,
R
.
font
.
peridot_semi_bold
,
mTvTelcoGiftValue
,
mFontButtonGetIt
);
WarpUtils
.
renderCustomFont
(
this
,
R
.
font
.
peridot_regular
,
mTvTelcoGiftType
,
mTvTelcoGiftDuration
,
...
...
@@ -104,6 +109,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
@Override
public
void
onResume
()
{
super
.
onResume
();
mIsActivatePressed
=
false
;
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"screen"
,
"TelcoScreen"
);
// new Thread(() -> {
...
...
@@ -122,7 +128,10 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
ll_activate_button
)
{
if
(!
mIsActivatePressed
)
{
mIsActivatePressed
=
true
;
showActivationDialog
();
}
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
ll_see_more
)
{
...
...
@@ -174,13 +183,20 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
private
void
showActivationDialog
()
{
final
BottomSheetDialog
bottomSheetDialog
=
new
BottomSheetDialog
(
this
,
R
.
style
.
BottomSheetDialog
);
bottomSheetDialog
.
setContentView
(
R
.
layout
.
dl_share
);
bottomSheetDialog
.
setOnDismissListener
(
dialog
->
{
mIsActivatePressed
=
false
;
bottomSheetDialog
.
dismiss
();
});
TextView
tvHeader
=
bottomSheetDialog
.
findViewById
(
R
.
id
.
tv_sender_value
);
WarpUtils
.
renderCustomFont
(
this
,
R
.
font
.
bt_cosmo_bold
,
tvHeader
);
tvHeader
.
setText
(
R
.
string
.
cos_coupon_share_telco
);
LinearLayout
parent
=
bottomSheetDialog
.
findViewById
(
R
.
id
.
ll_share_dialog_view_inner
);
ImageView
dialogClose
=
(
ImageView
)
bottomSheetDialog
.
findViewById
(
R
.
id
.
iv_sender_list_close
);
dialogClose
.
setOnClickListener
(
view
->
bottomSheetDialog
.
dismiss
());
dialogClose
.
setOnClickListener
(
view
->
{
mIsActivatePressed
=
false
;
bottomSheetDialog
.
dismiss
();
});
if
(
mCCMS
.
getEligibleAssets
()
!=
null
&&
mCCMS
.
getEligibleAssets
().
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
mCCMS
.
getEligibleAssets
().
size
();
i
++)
{
...
...
@@ -245,9 +261,11 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
.
setTitle
(
R
.
string
.
cos_dlg_activate_telco_title
)
.
setMessage
(
R
.
string
.
cos_dlg_activate_telco_subtitle
)
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button
,
(
dialogPositive
,
whichPositive
)
->
{
mPbLoading
.
setVisibility
(
View
.
VISIBLE
);
activateGift
();
})
.
setNegativeButton
(
R
.
string
.
cos_dlg_negative_button2
,
(
dialogNegative
,
whichNegative
)
->
{
mIsActivatePressed
=
false
;
dialogNegative
.
dismiss
();
})
.
show
();
...
...
@@ -315,8 +333,10 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
private
CallbackReceiver
<
JSONObject
>
mSubmitCallback
=
new
CallbackReceiver
<
JSONObject
>()
{
@Override
public
void
onSuccess
(
JSONObject
result
)
{
mIsActivatePressed
=
false
;
int
status
=
result
.
optInt
(
"status"
,
2
);
runOnUiThread
(()
->
{
mPbLoading
.
setVisibility
(
View
.
GONE
);
if
(
status
==
1
)
successActivatingDialog
();
else
...
...
@@ -346,7 +366,11 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
@Override
public
void
onFailure
(
int
errorCode
)
{
runOnUiThread
(()
->
errorActivatingDialog
());
mIsActivatePressed
=
false
;
runOnUiThread
(()
->
{
mPbLoading
.
setVisibility
(
View
.
GONE
);
errorActivatingDialog
();
});
}
};
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/UnifiedCouponInfoActivity.java
View file @
b43f6b7
...
...
@@ -72,7 +72,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
mLlCancelUnified
;
private
UnifiedCoupon
mCoupon
;
private
boolean
mIsBarcodeShown
=
false
,
mIsTermsShown
=
false
,
mIsFromWallet
=
false
,
mIsMarketExpand
=
true
,
mShopsPressed
=
false
,
mCouponPressed
=
false
;
mIsMarketExpand
=
true
,
mShopsPressed
=
false
,
mCouponPressed
=
false
,
mCancelPressed
=
false
;
private
RecyclerView
mRecyclerCoupons
;
private
ActiveCouponAdapter
mAdapterCoupons
;
private
AlertDialog
mErrorAlertDialog
,
mSuccessAlertDialog
,
mAskCancelUnifiedAlertDialog
;
...
...
@@ -144,6 +144,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"screen"
,
"UnifiedCouponScreen"
);
mShopsPressed
=
false
;
mCouponPressed
=
false
;
mCancelPressed
=
false
;
}
@Override
...
...
@@ -184,9 +185,12 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
ll_cancel_coupon
)
{
if
(!
mCancelPressed
)
{
mCancelPressed
=
true
;
askCancelUnifiedDialog
();
}
}
}
// ===========================================================
// Methods
...
...
@@ -438,6 +442,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
cancelUnified
();
})
.
setNegativeButton
(
R
.
string
.
cos_dlg_negative_button4
,
(
dialogNegative
,
whichNegative
)
->
{
mCancelPressed
=
false
;
dialogNegative
.
dismiss
();
})
.
show
();
...
...
@@ -476,12 +481,14 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
private
final
CallbackReceiver
<
Integer
>
mCancelUnifiedCallback
=
new
CallbackReceiver
<
Integer
>()
{
@Override
public
void
onSuccess
(
Integer
result
)
{
mCancelPressed
=
false
;
mPbLoading
.
setVisibility
(
View
.
GONE
);
successDialog
();
}
@Override
public
void
onFailure
(
int
errorCode
)
{
mCancelPressed
=
false
;
mPbLoading
.
setVisibility
(
View
.
GONE
);
errorDialog
();
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
b43f6b7
...
...
@@ -1349,6 +1349,34 @@ public class WarplyManagerHelper {
}
}
public
static
void
updateCampaignItem
(
String
sessionUuid
)
{
Campaign
tempCampaign
;
for
(
Campaign
cmp
:
WarplyManagerHelper
.
getCampaignListAll
())
{
if
(
cmp
.
getSessionUUID
().
equals
(
sessionUuid
))
{
if
(
mCampaignListAll
!=
null
&&
!
mCampaignListAll
.
isEmpty
())
{
mCampaignListAll
.
remove
(
cmp
);
tempCampaign
=
cmp
;
tempCampaign
.
setNew
(
false
);
mCampaignListAll
.
add
(
tempCampaign
);
}
break
;
}
}
Campaign
tempCarouselCampaign
;
for
(
Campaign
cmp
:
WarplyManagerHelper
.
getCarouselList
())
{
if
(
cmp
.
getSessionUUID
().
equals
(
sessionUuid
))
{
if
(
mCarouselList
!=
null
&&
!
mCarouselList
.
isEmpty
())
{
mCarouselList
.
remove
(
cmp
);
tempCarouselCampaign
=
cmp
;
tempCarouselCampaign
.
setNew
(
false
);
mCarouselList
.
add
(
tempCarouselCampaign
);
}
break
;
}
}
}
public
static
void
setCouponList
(
CouponList
couponList
)
{
LoyaltyBadgeModel
badge
=
new
LoyaltyBadgeModel
();
CouponList
cpnlist
=
new
CouponList
();
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
b43f6b7
...
...
@@ -5418,6 +5418,10 @@ public class WarplyManager {
dynatraceEvent
.
setEventName
(
"custom_success_read_campaign_loyalty"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
dynatraceEvent
));
/* New Addition start */
WarplyManagerHelper
.
updateCampaignItem
(
sessionUuid
);
/* New Addition end */
// getCampaigns(new CallbackReceiver<ArrayList<Campaign>>() {
// @Override
// public void onSuccess(ArrayList<Campaign> result) {
...
...
@@ -5439,6 +5443,10 @@ public class WarplyManager {
dynatraceEvent
.
setEventName
(
"custom_success_read_campaign_loyalty"
);
EventBus
.
getDefault
().
post
(
new
WarplyEventBusManager
(
dynatraceEvent
));
/* New Addition start */
WarplyManagerHelper
.
updateCampaignItem
(
sessionUuid
);
/* New Addition end */
// getCampaigns(new CallbackReceiver<ArrayList<Campaign>>() {
// @Override
// public void onSuccess(ArrayList<Campaign> result) {
...
...
warply_android_sdk/src/main/res/layout/activity_telco.xml
View file @
b43f6b7
...
...
@@ -216,4 +216,22 @@
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
<RelativeLayout
android:id=
"@+id/pb_loading"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_centerInParent=
"true"
android:background=
"@android:color/transparent"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<ProgressBar
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_centerInParent=
"true"
android:indeterminate=
"true"
android:indeterminateTint=
"@color/cos_green5"
android:indeterminateTintMode=
"src_atop"
/>
</RelativeLayout>
</RelativeLayout>
...
...
Please
register
or
login
to post a comment