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-04-11 16:25:27 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a9efbef711b08d71736e92c24f8c7466ff52a4a0
a9efbef7
1 parent
e462e2a0
added event for to go back
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
0 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyHistoryActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/WarplyNavigateBackEventModel.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyEventBusManager.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyHistoryActivity.java
View file @
a9efbef
...
...
@@ -5,6 +5,7 @@ import android.content.Context;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.text.SpannableStringBuilder
;
import
android.text.Spanned
;
import
android.view.View
;
...
...
@@ -13,6 +14,7 @@ import android.widget.RelativeLayout;
import
android.widget.TextView
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
import
java.util.Locale
;
...
...
@@ -75,6 +77,19 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
}
@Override
public
void
onStart
()
{
super
.
onStart
();
if
(!
EventBus
.
getDefault
().
isRegistered
(
this
))
EventBus
.
getDefault
().
register
(
this
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
EventBus
.
getDefault
().
unregister
(
this
);
}
@Override
public
void
onResume
()
{
super
.
onResume
();
WarplyAnalyticsManager
.
logTrackersEvent
(
this
,
"screen"
,
"HistoryScreen"
);
...
...
@@ -106,6 +121,13 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
}
}
@Subscribe
()
public
void
onMessageEvent
(
WarplyEventBusManager
event
)
{
if
(
event
.
getNavigateBackEventModel
()
!=
null
)
{
onBackPressed
();
}
}
@Override
public
void
onClick
(
View
view
)
{
if
(
view
.
getId
()
==
R
.
id
.
iv_loyalty_history_close
)
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/WarplyNavigateBackEventModel.java
0 → 100644
View file @
a9efbef
/*
* Copyright 2010-2013 Warply Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package
ly
.
warp
.
sdk
.
io
.
models
;
/**
* Created by Panagiotis Triantafyllou on 11-Apr-24.
*/
public
class
WarplyNavigateBackEventModel
{
private
boolean
goBack
;
public
WarplyNavigateBackEventModel
()
{
this
.
goBack
=
true
;
}
public
boolean
isGoBack
()
{
return
goBack
;
}
public
void
setGoBack
(
boolean
goBack
)
{
this
.
goBack
=
goBack
;
}
}
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyEventBusManager.java
View file @
a9efbef
...
...
@@ -24,6 +24,7 @@ import ly.warp.sdk.io.models.VouchersServiceUnavailableEventModel;
import
ly.warp.sdk.io.models.WarplyCCMSEnabledModel
;
import
ly.warp.sdk.io.models.WarplyCouponsChangedEventModel
;
import
ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel
;
import
ly.warp.sdk.io.models.WarplyNavigateBackEventModel
;
import
ly.warp.sdk.io.models.WarplyPacingCardEventModel
;
import
ly.warp.sdk.io.models.WarplyPacingCardServiceEnabledModel
;
import
ly.warp.sdk.io.models.WarplyPacingEventModel
;
...
...
@@ -56,6 +57,7 @@ public class WarplyEventBusManager {
private
RefreshVouchersEventModel
vouchersRefreshed
;
private
UnifiedCouponsEventModel
unifiedCouponsAdded
;
private
RefreshUnifiedCouponsEventModel
refreshUnifiedCouponsAdded
;
private
WarplyNavigateBackEventModel
navigateBackEvent
;
private
LoyaltyEventModel
campaignsAdded
;
private
HealthEventModel
healthAdded
;
private
WarplyCouponsChangedEventModel
couponsChanged
;
...
...
@@ -127,6 +129,10 @@ public class WarplyEventBusManager {
this
.
refreshUnifiedCouponsAdded
=
refreshUnifiedCouponsAdded
;
}
public
WarplyEventBusManager
(
WarplyNavigateBackEventModel
navigateBackEvent
)
{
this
.
navigateBackEvent
=
navigateBackEvent
;
}
public
WarplyEventBusManager
(
WarplyPacingCardEventModel
widgetChanged
)
{
this
.
widgetChanged
=
widgetChanged
;
}
...
...
@@ -321,6 +327,10 @@ public class WarplyEventBusManager {
return
serviceUnavailable
;
}
public
WarplyNavigateBackEventModel
getNavigateBackEventModel
()
{
return
navigateBackEvent
;
}
public
RefreshVouchersEventModel
getRefreshVouchersEventModel
()
{
return
vouchersRefreshed
;
}
...
...
Please
register
or
login
to post a comment