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-07-19 18:56:49 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7e272c42002af47640b24fa53f1658a5d582cbd7
7e272c42
1 parent
9d218794
new inbox
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
24 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/callbacks/NewCampaignsHook.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
warply_android_sdk/src/main/res/layout/activity_active_coupons.xml
warply_android_sdk/build.gradle
View file @
7e272c4
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta3
6
'
PUBLISH_VERSION
=
'4.5.4-cosbeta3
7i
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
View file @
7e272c4
...
...
@@ -70,8 +70,8 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
new
Thread
(()
->
{
if
(!
Thread
.
currentThread
().
isInterrupted
())
{
// WarplyManager.getConsumer(new WarplyConsumerRequest(), mConsumerReceiver);
Warply
.
getInbox
(
new
WarplyInboxRequest
().
setUseCache
(
false
),
mInboxReceiver
);
//
WarplyManager.getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), mCampaignsCallback);
//
Warply.getInbox(new WarplyInboxRequest().setUseCache(false), mInboxReceiver);
WarplyManager
.
getCampaigns
(
new
WarplyGetCampaignsRequest
().
setLanguage
(
"en"
),
mCampaignsCallback
);
}
}).
start
();
}
...
...
@@ -207,9 +207,9 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
}
};
private
CallbackReceiver
<
NewCampaignList
>
mCampaignsCallback
=
new
CallbackReceiver
<
New
CampaignList
>()
{
private
CallbackReceiver
<
CampaignList
>
mCampaignsCallback
=
new
CallbackReceiver
<
CampaignList
>()
{
@Override
public
void
onSuccess
(
New
CampaignList
result
)
{
public
void
onSuccess
(
CampaignList
result
)
{
WarplyManager
.
getUserCouponsWithCouponsets
(
new
WarplyUserCouponsRequest
(),
mUserCouponsReceiver
);
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/callbacks/NewCampaignsHook.java
View file @
7e272c4
...
...
@@ -27,6 +27,9 @@ package ly.warp.sdk.io.callbacks;
import
org.json.JSONObject
;
import
ly.warp.sdk.io.models.Campaign
;
import
ly.warp.sdk.io.models.CampaignList
;
import
ly.warp.sdk.io.models.NewCampaign
;
import
ly.warp.sdk.io.models.NewCampaignList
;
/**
...
...
@@ -35,10 +38,10 @@ import ly.warp.sdk.io.models.NewCampaignList;
public
class
NewCampaignsHook
implements
CallbackReceiver
<
JSONObject
>
{
private
final
CallbackReceiver
<
New
CampaignList
>
mListener
;
private
final
CallbackReceiver
<
CampaignList
>
mListener
;
private
final
String
mRequestSignature
;
public
NewCampaignsHook
(
CallbackReceiver
<
New
CampaignList
>
listener
,
String
requestSignature
)
{
public
NewCampaignsHook
(
CallbackReceiver
<
CampaignList
>
listener
,
String
requestSignature
)
{
this
.
mListener
=
listener
;
this
.
mRequestSignature
=
requestSignature
;
}
...
...
@@ -48,7 +51,36 @@ public class NewCampaignsHook implements CallbackReceiver<JSONObject> {
if
(
mListener
!=
null
)
{
int
status
=
result
.
optInt
(
"status"
,
2
);
if
(
status
==
1
)
{
mListener
.
onSuccess
(
new
NewCampaignList
(
result
,
mRequestSignature
));
NewCampaignList
cmpList
=
new
NewCampaignList
(
result
,
mRequestSignature
);
CampaignList
tempCampaigns
=
new
CampaignList
();
for
(
NewCampaign
newCamp
:
cmpList
)
{
Campaign
camp
=
new
Campaign
();
camp
.
setIndexUrl
(
newCamp
.
getIndexUrl
());
camp
.
setLogoUrl
(
newCamp
.
getLogoUrl
());
camp
.
setMessage
(
newCamp
.
getMessage
());
camp
.
setOfferCategory
(
newCamp
.
getCommunicationCategory
());
camp
.
setSessionUUID
(
newCamp
.
getCommunicationUUID
());
camp
.
setTitle
(
newCamp
.
getTitle
());
camp
.
setSubtitle
(
newCamp
.
getSubtitle
());
camp
.
setSorting
(
newCamp
.
getSorting
());
camp
.
setNew
(
newCamp
.
getIsNew
());
camp
.
setType
(
newCamp
.
getCampaignType
());
try
{
camp
.
setExtraFields
(
newCamp
.
getExtraFields
().
toString
());
}
catch
(
NullPointerException
e
)
{
camp
.
setExtraFields
(
""
);
e
.
printStackTrace
();
}
try
{
camp
.
setCampaignTypeSettings
(
newCamp
.
getSettings
().
toString
());
}
catch
(
NullPointerException
e
)
{
camp
.
setCampaignTypeSettings
(
""
);
e
.
printStackTrace
();
}
tempCampaigns
.
add
(
camp
);
}
mListener
.
onSuccess
(
tempCampaigns
);
}
else
mListener
.
onFailure
(
status
);
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
7e272c4
This diff is collapsed. Click to expand it.
warply_android_sdk/src/main/res/layout/activity_active_coupons.xml
View file @
7e272c4
<?xml version="1.0" encoding="utf-8"?>
<
Relative
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/cl_bill_payment"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:background=
"@android:color/white"
android:orientation=
"vertical"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_bill_header"
android:layout_width=
"match_parent"
android:layout_height=
"80dp"
android:background=
"@android:color/white"
app:layout_constraintTop_toTopOf=
"parent"
>
android:background=
"@android:color/white"
>
<ImageView
android:id=
"@+id/iv_coupons_close"
...
...
@@ -38,23 +39,21 @@
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<
androidx.constraintlayout.widget.Constraint
Layout
<
Relative
Layout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_below=
"@+id/cl_bill_header"
android:layout_marginTop=
"1dp"
android:background=
"@drawable/shape_cos_loyalty"
>
android:background=
"@drawable/shape_cos_loyalty"
android:orientation=
"vertical"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_active_coupons"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:paddingTop=
"44dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:paddingTop=
"44dp"
/>
</RelativeLayout>
<TextView
android:id=
"@+id/tv_no_coupons"
...
...
@@ -66,4 +65,4 @@
android:textSize=
"18sp"
android:textStyle=
"bold"
android:visibility=
"gone"
/>
</RelativeLayout>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment