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-05 12:57:51 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d0ed2a61cc5c6c20652b81406b29bde4444ee4ad
d0ed2a61
1 parent
c9269dd0
minor addition
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
View file @
d0ed2a6
...
...
@@ -24,12 +24,14 @@ import java.util.ArrayList;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.activities.ActiveCouponsActivity
;
import
ly.warp.sdk.activities.BaseFragmentActivity
;
import
ly.warp.sdk.activities.TelematicsActivity
;
import
ly.warp.sdk.activities.TelematicsHistoryActivity
;
import
ly.warp.sdk.activities.WarpViewActivity
;
import
ly.warp.sdk.io.callbacks.CallbackReceiver
;
import
ly.warp.sdk.io.models.Campaign
;
import
ly.warp.sdk.io.models.CouponList
;
import
ly.warp.sdk.io.models.UnifiedCoupon
;
import
ly.warp.sdk.io.request.WarplyGetCampaignsRequest
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
import
ly.warp.sdk.utils.managers.WarplyManager
;
...
...
@@ -103,6 +105,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
public
void
onRefresh
()
{
WarplyManager
.
getUserCouponsWithCouponsets
(
mUserCouponsReceiver
);
WarplyManager
.
getCampaigns
(
mCampaignsCallback
);
WarplyManager
.
getUnifiedCouponsDeals
(
mUnifiedCallback
);
mSwipeRefresh
.
setRefreshing
(
false
);
}
...
...
@@ -159,6 +162,18 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
}
};
private
final
CallbackReceiver
<
ArrayList
<
UnifiedCoupon
>>
mUnifiedCallback
=
new
CallbackReceiver
<
ArrayList
<
UnifiedCoupon
>>()
{
@Override
public
void
onSuccess
(
ArrayList
<
UnifiedCoupon
>
result
)
{
Toast
.
makeText
(
getActivity
(),
"Unified Coupons Success "
+
String
.
valueOf
(
result
.
size
()),
Toast
.
LENGTH_SHORT
).
show
();
}
@Override
public
void
onFailure
(
int
errorCode
)
{
Toast
.
makeText
(
getActivity
(),
"Unified Coupons Error"
,
Toast
.
LENGTH_SHORT
).
show
();
}
};
private
final
CallbackReceiver
<
JSONObject
>
mLogoutReceiver
=
new
CallbackReceiver
<
JSONObject
>()
{
@Override
public
void
onSuccess
(
JSONObject
result
)
{
...
...
Please
register
or
login
to post a comment