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-10-11 16:18:17 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7f82f324583fe188a5ff42109ede6c6119e85c3f
7f82f324
1 parent
46c74ba4
new keys
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
80 additions
and
104 deletions
app/src/main/assets/warply.properties
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/ActiveCouponsActivity.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/LoyaltyWallet.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/request/WarplyGetCouponsetsRequest.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/request/WarplyJsonArrayRequest.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/request/WarplyJsonObjectRequest.java
warply_android_sdk/src/main/res/drawable-xhdpi/ic_background_transparent.png
warply_android_sdk/src/main/res/drawable-xhdpi/ic_background_transparent_shadow.png
warply_android_sdk/src/main/res/drawable-xhdpi/ic_line_transparent.png
warply_android_sdk/src/main/res/drawable/svg_background_transparent.xml
warply_android_sdk/src/main/res/layout/activity_gifts_for_you.xml
warply_android_sdk/src/main/res/layout/activity_more_for_you.xml
app/src/main/assets/warply.properties
View file @
7f82f32
...
...
@@ -3,7 +3,7 @@
# The app uuid the warply sdk need to connect to the engage server
# dev f83dfde1145e4c2da69793abb2f579af
# prod 0086a2088301440792091b9f814c2267
Uuid
=
0086a2088301440792091b9f814c2267
Uuid
=
f83dfde1145e4c2da69793abb2f579af
# If we need to see logs in Logcat
Debug
=
true
...
...
@@ -11,7 +11,7 @@ Debug=true
# Production or Development environment of the engage server
# Production: https://engage.warp.ly
# Development: https://engage-stage.warp.ly
BaseURL
=
https://engage.warp.ly
BaseURL
=
https://engage
-stage
.warp.ly
# For Verify Ticket request
VerifyURL
=
/partners/cosmote/verify
...
...
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
View file @
7f82f32
...
...
@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public
void
onWarplyReady
()
{
if
(!
WarplyDBHelper
.
getInstance
(
SplashActivity
.
this
).
isTableNotEmpty
(
"auth"
))
{
WarplyManager
.
getCosmoteUser
(
new
WarplyCosmoteUserRequest
()
.
setGuid
(
"
6006552990
"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990
.
setGuid
(
"
7000000831
"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990
mLoginReceiver
);
}
else
{
startNextActivity
();
...
...
warply_android_sdk/build.gradle
View file @
7f82f32
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta8
8
'
PUBLISH_VERSION
=
'4.5.4-cosbeta8
9
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/ActiveCouponsActivity.java
View file @
7f82f32
...
...
@@ -15,13 +15,13 @@ import java.io.Serializable;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
import
io.github.inflationx.viewpump.ViewPumpContextWrapper
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.io.models.Coupon
;
import
ly.warp.sdk.io.models.CouponList
;
import
ly.warp.sdk.utils.WarplyManagerHelper
;
import
ly.warp.sdk.utils.managers.WarplyAnalyticsManager
;
import
ly.warp.sdk.views.adapters.ActiveCouponAdapter
;
...
...
@@ -51,50 +51,9 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_active_coupons
);
if
(
getIntent
().
getExtras
()
!=
null
&&
getIntent
().
getSerializableExtra
(
"couponlist"
)
!=
null
)
{
mCouponList
=
new
CouponList
(
getIntent
().
getSerializableExtra
(
"couponlist"
).
toString
(),
true
);
CouponList
cpnlist
=
new
CouponList
();
for
(
Coupon
cpn
:
mCouponList
)
{
if
(
cpn
.
getStatus
()
==
1
)
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm"
);
Date
newDate
=
new
Date
();
try
{
newDate
=
simpleDateFormat
.
parse
(
cpn
.
getExpiration
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
cpn
.
setExpirationDate
(
newDate
);
cpnlist
.
add
(
cpn
);
}
}
Collections
.
sort
(
cpnlist
,
(
coupon1
,
coupon2
)
->
coupon1
.
getExpirationDate
().
compareTo
(
coupon2
.
getExpirationDate
()));
mCouponList
.
clear
();
mCouponList
.
addAll
(
cpnlist
);
}
mIvBack
=
findViewById
(
R
.
id
.
iv_coupons_close
);
mTvEmptyCoupons
=
findViewById
(
R
.
id
.
tv_no_coupons
);
if
(
mCouponList
!=
null
)
{
mRecyclerCoupons
=
findViewById
(
R
.
id
.
rv_active_coupons
);
mRecyclerCoupons
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
mAdapterCoupons
=
new
ActiveCouponAdapter
(
this
,
mCouponList
);
mRecyclerCoupons
.
setAdapter
(
mAdapterCoupons
);
mAdapterCoupons
.
getPositionClicks
()
.
doOnNext
(
coupon
->
{
WarplyAnalyticsManager
.
logTrackersEvent
(
"click"
,
(
"Coupon"
).
concat
(
":"
).
concat
(
coupon
.
getName
()));
Intent
intent
=
new
Intent
(
ActiveCouponsActivity
.
this
,
CouponInfoActivity
.
class
);
intent
.
putExtra
(
"coupon"
,
(
Serializable
)
coupon
);
startActivity
(
intent
);
})
.
doOnError
(
error
->
{
})
.
subscribe
();
}
else
{
mTvEmptyCoupons
.
setVisibility
(
View
.
VISIBLE
);
}
mRecyclerCoupons
=
findViewById
(
R
.
id
.
rv_active_coupons
);
initViews
();
}
...
...
@@ -103,6 +62,7 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe
public
void
onResume
()
{
super
.
onResume
();
WarplyAnalyticsManager
.
logTrackersEvent
(
"screen"
,
"ActiveCouponsScreen"
);
filterItems
();
}
@Override
...
...
@@ -125,6 +85,44 @@ public class ActiveCouponsActivity extends Activity implements View.OnClickListe
mIvBack
.
setOnClickListener
(
this
);
}
private
void
filterItems
()
{
CouponList
cpnlist
=
new
CouponList
();
for
(
Coupon
cpn
:
WarplyManagerHelper
.
getCouponList
())
{
if
(
cpn
.
getStatus
()
==
1
)
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd hh:mm"
);
Date
newDate
=
new
Date
();
try
{
newDate
=
simpleDateFormat
.
parse
(
cpn
.
getExpiration
());
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
cpn
.
setExpirationDate
(
newDate
);
cpnlist
.
add
(
cpn
);
}
}
Collections
.
sort
(
cpnlist
,
(
coupon1
,
coupon2
)
->
coupon1
.
getExpirationDate
().
compareTo
(
coupon2
.
getExpirationDate
()));
mCouponList
.
clear
();
mCouponList
.
addAll
(
cpnlist
);
if
(
mCouponList
!=
null
&&
mCouponList
.
size
()
>
0
)
{
mRecyclerCoupons
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
mAdapterCoupons
=
new
ActiveCouponAdapter
(
this
,
mCouponList
);
mRecyclerCoupons
.
setAdapter
(
mAdapterCoupons
);
mAdapterCoupons
.
getPositionClicks
()
.
doOnNext
(
coupon
->
{
WarplyAnalyticsManager
.
logTrackersEvent
(
"click"
,
(
"Coupon"
).
concat
(
":"
).
concat
(
coupon
.
getName
()));
Intent
intent
=
new
Intent
(
ActiveCouponsActivity
.
this
,
CouponInfoActivity
.
class
);
intent
.
putExtra
(
"coupon"
,
(
Serializable
)
coupon
);
startActivity
(
intent
);
})
.
doOnError
(
error
->
{
})
.
subscribe
();
}
else
{
mTvEmptyCoupons
.
setVisibility
(
View
.
VISIBLE
);
}
}
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponShareActivity.java
View file @
7f82f32
...
...
@@ -95,13 +95,8 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
super
.
onResume
();
WarplyAnalyticsManager
.
logTrackersEvent
(
"screen"
,
"CouponShareScreen"
);
new
Thread
(()
->
{
if
(!
Thread
.
currentThread
().
isInterrupted
())
{
WarplyManager
.
getConsumer
(
new
WarplyConsumerRequest
()
,
mConsumerCallback
);
}
Thread
.
currentThread
().
interrupt
();
}).
start
();
WarplyManager
.
getConsumer
(
new
WarplyConsumerRequest
()
,
mConsumerCallback
);
}
@Override
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponsetInfoActivity.java
View file @
7f82f32
...
...
@@ -2,6 +2,7 @@ package ly.warp.sdk.activities;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.text.Html
;
import
android.text.TextUtils
;
...
...
@@ -241,6 +242,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button2
,
(
dialogPositive
,
whichPositive
)
->
{
dialogPositive
.
dismiss
();
if
(
success
)
{
// setResult(RESULT_OK, new Intent());
onBackPressed
();
}
})
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
View file @
7f82f32
...
...
@@ -114,44 +114,6 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mSvLoyaltyWallet
=
findViewById
(
R
.
id
.
sv_loyalty_wallet
);
mClToolbar
=
findViewById
(
R
.
id
.
cl_loyalty_wallet_header
);
// ArrayList<ActiveDFYCouponModel> dlist = new ArrayList<>();
// ActiveDFYCouponModel model = new ActiveDFYCouponModel();
// model.setCode("123456789");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456780");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456781");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456782");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456783");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456784");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456785");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// WarplyManagerHelper.setActiveDFYCoupons(dlist);
if
(
WarplyManagerHelper
.
getActiveDFYCoupons
()
!=
null
)
{
Collections
.
sort
(
WarplyManagerHelper
.
getActiveDFYCoupons
(),
new
Comparator
<
ActiveDFYCouponModel
>()
{
public
int
compare
(
ActiveDFYCouponModel
o1
,
ActiveDFYCouponModel
o2
)
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/request/WarplyGetCouponsetsRequest.java
View file @
7f82f32
package
ly
.
warp
.
sdk
.
io
.
request
;
import
android.text.TextUtils
;
import
android.util.Base64
;
import
org.json.JSONArray
;
...
...
@@ -171,7 +172,7 @@ public class WarplyGetCouponsetsRequest {
bodyJsonObject
.
putOpt
(
KEY_ACTION
,
KEY_ACTION_VALUE
);
bodyJsonObject
.
putOpt
(
KEY_ACTIVE
,
mActive
);
bodyJsonObject
.
putOpt
(
KEY_VISIBLE
,
mVisible
);
bodyJsonObject
.
putOpt
(
KEY_LANGUAGE
,
mLanguage
);
bodyJsonObject
.
putOpt
(
KEY_LANGUAGE
,
TextUtils
.
isEmpty
(
mLanguage
)
?
"el"
:
mLanguage
);
if
(
mUuids
!=
null
&&
mUuids
.
size
()
>
0
)
bodyJsonObject
.
putOpt
(
KEY_UUIDS
,
new
JSONArray
(
mUuids
));
}
catch
(
JSONException
e
)
{
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/request/WarplyJsonArrayRequest.java
View file @
7f82f32
...
...
@@ -74,7 +74,7 @@ public class WarplyJsonArrayRequest extends JsonRequest<JSONObject> {
headers
.
put
(
WarpConstants
.
HEADER_LOYALTY_BUNDLE_ID
,
"android:"
+
context
.
getPackageName
());
headers
.
put
(
WarpConstants
.
HEADER_DATE
,
timeStamp
);
headers
.
put
(
WarpConstants
.
HEADER_UNIQUE_DEVICE_ID
,
new
WarplyDeviceInfoCollector
(
context
).
getUniqueDeviceId
());
headers
.
put
(
WarpConstants
.
HEADER_ADVERTISING_ID
,
new
WarplyDeviceInfoCollector
(
context
).
getAdvertisementId
());
//
headers.put(WarpConstants.HEADER_ADVERTISING_ID, new WarplyDeviceInfoCollector(context).getAdvertisementId());
headers
.
put
(
WarpConstants
.
HEADER_CHANNEL
,
"mobile"
);
if
(
WarpUtils
.
isRegisteredWarply
(
context
))
{
String
apiKey
=
WarpUtils
.
getApiKey
(
context
);
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/request/WarplyJsonObjectRequest.java
View file @
7f82f32
...
...
@@ -58,7 +58,7 @@ public class WarplyJsonObjectRequest extends JsonObjectRequest {
headers
.
put
(
WarpConstants
.
HEADER_LOYALTY_BUNDLE_ID
,
"android:"
+
context
.
getPackageName
());
headers
.
put
(
WarpConstants
.
HEADER_DATE
,
timeStamp
);
headers
.
put
(
WarpConstants
.
HEADER_UNIQUE_DEVICE_ID
,
new
WarplyDeviceInfoCollector
(
context
).
getUniqueDeviceId
());
headers
.
put
(
WarpConstants
.
HEADER_ADVERTISING_ID
,
new
WarplyDeviceInfoCollector
(
context
).
getAdvertisementId
());
//
headers.put(WarpConstants.HEADER_ADVERTISING_ID, new WarplyDeviceInfoCollector(context).getAdvertisementId());
headers
.
put
(
WarpConstants
.
HEADER_CHANNEL
,
"mobile"
);
if
(
WarpUtils
.
isRegisteredWarply
(
context
))
{
String
apiKey
=
WarpUtils
.
getApiKey
(
context
);
...
...
warply_android_sdk/src/main/res/drawable-xhdpi/ic_background_transparent.png
0 → 100644
View file @
7f82f32
1.02 KB
warply_android_sdk/src/main/res/drawable-xhdpi/ic_background_transparent_shadow.png
0 → 100644
View file @
7f82f32
1.89 KB
warply_android_sdk/src/main/res/drawable-xhdpi/ic_line_transparent.png
0 → 100644
View file @
7f82f32
443 Bytes
warply_android_sdk/src/main/res/drawable/svg_background_transparent.xml
0 → 100644
View file @
7f82f32
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"428dp"
android:height=
"106dp"
android:viewportWidth=
"428"
android:viewportHeight=
"106"
>
<group>
<clip-path
android:pathData=
"M0,0h428v106h-428z"
/>
<path
android:pathData=
"M0,98v-98h428v77.99L39,77.99a48.15,48.15 0,0 0,-39 20.01Z"
android:fillColor=
"#fff"
/>
</group>
</vector>
warply_android_sdk/src/main/res/layout/activity_gifts_for_you.xml
View file @
7f82f32
...
...
@@ -5,20 +5,22 @@
android:id=
"@+id/cl_bill_payment"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@
android:color/white
"
android:background=
"@
color/cos_grey5
"
android:orientation=
"vertical"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_bill_header"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:background=
"@android:color/white"
>
android:layout_height=
"64dp"
android:translationZ=
"10dp"
android:background=
"@drawable/ic_background_transparent_shadow"
>
<ImageView
android:id=
"@+id/iv_list_close"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_marginStart=
"16dp"
android:layout_marginBottom=
"16dp"
android:scaleType=
"centerInside"
android:src=
"@drawable/ic_back"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
@@ -32,6 +34,7 @@
android:gravity=
"center"
android:textColor=
"@color/grey"
android:textSize=
"17sp"
android:layout_marginBottom=
"16dp"
fontPath=
"fonts/pf_square_sans_pro_bold.ttf"
android:text=
"@string/cos_gifts_title"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
@@ -43,7 +46,7 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:
background=
"@drawable/shape_cos_loyalty_no_border
"
android:
layout_marginTop=
"-18dp
"
android:orientation=
"vertical"
>
<LinearLayout
...
...
@@ -97,7 +100,6 @@
android:id=
"@+id/rv_merged_gifts"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:clipToPadding=
"false"
android:orientation=
"vertical"
android:overScrollMode=
"never"
...
...
warply_android_sdk/src/main/res/layout/activity_more_for_you.xml
View file @
7f82f32
...
...
@@ -4,21 +4,23 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@
android:color/white
"
android:background=
"@
color/cos_grey5
"
android:fillViewport=
"true"
android:orientation=
"vertical"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_more_header"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
app:layout_constraintTop_toTopOf=
"parent"
>
android:layout_height=
"64dp"
android:translationZ=
"10dp"
android:background=
"@drawable/ic_background_transparent_shadow"
>
<ImageView
android:id=
"@+id/iv_list_close"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_marginStart=
"16dp"
android:layout_marginBottom=
"16dp"
android:scaleType=
"centerInside"
android:src=
"@drawable/ic_back"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
@@ -30,6 +32,7 @@
fontPath=
"fonts/pf_square_sans_pro_bold.ttf"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"16dp"
android:gravity=
"center"
android:text=
"@string/cos_more_title"
android:textColor=
"@color/grey"
...
...
@@ -43,7 +46,7 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:
background=
"@drawable/shape_cos_loyalty_no_border
"
android:
layout_marginTop=
"-18dp
"
android:orientation=
"vertical"
>
<ScrollView
...
...
Please
register
or
login
to post a comment