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-09-12 18:38:40 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c79fa6214f70f0ae50a05a7a401e0fc27c46cd99
c79fa621
1 parent
1075cbbe
new keys
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
12 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/PacingDetails.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_loyalty_wallet.xml
warply_android_sdk/build.gradle
View file @
c79fa62
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta6
0
'
PUBLISH_VERSION
=
'4.5.4-cosbeta6
1
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/PacingDetails.java
View file @
c79fa62
...
...
@@ -47,11 +47,15 @@ public class PacingDetails {
private
static
final
String
METERS
=
"meters"
;
private
static
final
String
RESULT
=
"result"
;
private
static
final
String
ENABLED
=
"enabled"
;
private
static
final
String
GOAL_REACHED
=
"goal_reached"
;
private
static
final
String
MESSAGE
=
"msg"
;
/* Member variables of the Campaign object */
private
PacingInner
steps
=
new
PacingInner
();
private
PacingInner
meters
=
new
PacingInner
();
private
boolean
enabled
=
false
;
private
boolean
goal_reached
=
false
;
private
String
msg
=
""
;
/**
* Basic constructor used to create an object from a String, representing a
...
...
@@ -81,6 +85,8 @@ public class PacingDetails {
this
.
meters
=
new
PacingInner
(
result
.
optJSONObject
(
METERS
));
}
this
.
enabled
=
result
.
optBoolean
(
ENABLED
);
this
.
goal_reached
=
result
.
optBoolean
(
GOAL_REACHED
);
this
.
msg
=
result
.
optString
(
MESSAGE
);
}
}
}
...
...
@@ -96,6 +102,8 @@ public class PacingDetails {
jObj
.
putOpt
(
STEPS
,
this
.
steps
);
jObj
.
putOpt
(
METERS
,
this
.
meters
);
jObj
.
putOpt
(
ENABLED
,
this
.
enabled
);
jObj
.
putOpt
(
ENABLED
,
this
.
goal_reached
);
jObj
.
putOpt
(
ENABLED
,
this
.
msg
);
}
catch
(
JSONException
e
)
{
if
(
WarpConstants
.
DEBUG
)
{
e
.
printStackTrace
();
...
...
@@ -324,4 +332,12 @@ public class PacingDetails {
public
void
setMeters
(
PacingInner
meters
)
{
this
.
meters
=
meters
;
}
public
boolean
isGoal_reached
()
{
return
goal_reached
;
}
public
String
getMsg
()
{
return
msg
;
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
c79fa62
...
...
@@ -177,9 +177,11 @@ public class WarplyManagerHelper {
}
}
}
else
if
(
status
==
4
)
{
errorExpiredDialog
(
context
);
String
modalText4
=
result
.
optString
(
"msg"
,
""
);
errorExpiredDialog
(
context
,
modalText4
);
}
else
if
(
status
==
5
)
{
errorUsedDialog
(
context
);
String
modalText5
=
result
.
optString
(
"msg"
,
""
);
errorUsedDialog
(
context
,
modalText5
);
}
else
errorSharingDialog
(
context
);
}
...
...
@@ -325,10 +327,10 @@ public class WarplyManagerHelper {
/**
* Expired dialog
*/
private
static
void
errorExpiredDialog
(
Context
context
)
{
private
static
void
errorExpiredDialog
(
Context
context
,
String
message
)
{
mAlertDialogErrorExpiredSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cos_dlg_error_title
)
.
setMessage
(
R
.
string
.
cos_dlg_error_expired
)
.
setMessage
(
message
)
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button2
,
(
dialogPositive
,
whichPositive
)
->
{
dialogPositive
.
dismiss
();
})
...
...
@@ -338,10 +340,10 @@ public class WarplyManagerHelper {
/**
* Used dialog
*/
private
static
void
errorUsedDialog
(
Context
context
)
{
private
static
void
errorUsedDialog
(
Context
context
,
String
message
)
{
mAlertDialogErrorUsedSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cos_dlg_error_title
)
.
setMessage
(
R
.
string
.
cos_dlg_error_used
)
.
setMessage
(
message
)
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button2
,
(
dialogPositive
,
whichPositive
)
->
{
dialogPositive
.
dismiss
();
})
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
c79fa62
...
...
@@ -523,6 +523,7 @@ public class WarplyManager {
WarpUtils
.
log
(
"**************************************************"
);
WarpUtils
.
setUserNonTelco
(
Warply
.
getWarplyContext
(),
false
);
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
""
);
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
deleteAuth
();
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
deleteClient
();
...
...
@@ -2168,10 +2169,10 @@ public class WarplyManager {
Warply
.
postReceiveMicroappData
(
true
,
"context"
,
request
.
toJson
(),
new
PacingDetailsHook
(
new
CallbackReceiver
<
PacingDetails
>()
{
@Override
public
void
onSuccess
(
PacingDetails
result
)
{
if
(
result
.
getMeters
().
getMonth
().
getValue
()
>=
result
.
getMeters
().
getMonth
().
getGoal
())
{
if
(
result
.
isGoal_reached
())
{
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cos_dlg_success_title
)
.
setMessage
(
R
.
string
.
cos_dlg_pacing_goal
)
.
setMessage
(
result
.
getMsg
()
)
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button2
,
(
dialogPositive
,
whichPositive
)
->
{
dialogPositive
.
dismiss
();
})
...
...
warply_android_sdk/src/main/res/layout/activity_loyalty_wallet.xml
View file @
c79fa62
...
...
@@ -68,12 +68,12 @@
android:id=
"@+id/ll_user_badge"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_cos_gradient6"
android:background=
"@drawable/shape_cos_gradient6
_shahow
"
android:gravity=
"center"
android:paddingHorizontal=
"10dp"
android:paddingVertical=
"3dp"
android:visibility=
"gone"
tools:visibility=
"
gon
e"
>
tools:visibility=
"
visibl
e"
>
<TextView
android:id=
"@+id/tv_type"
...
...
@@ -93,7 +93,7 @@
android:paddingHorizontal=
"8dp"
android:paddingVertical=
"4dp"
android:visibility=
"gone"
tools:visibility=
"
visibl
e"
>
tools:visibility=
"
gon
e"
>
<TextView
android:id=
"@+id/tv_questionnaire"
...
...
Please
register
or
login
to post a comment