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-30 13:24:55 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e9cc8711bafd30d1a06b474a42e47ef64b2c9878
e9cc8711
1 parent
237b1b35
minor fixes
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
49 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponShareActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyAnalysisActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
warply_android_sdk/src/main/java/ly/warp/sdk/services/WarplyHealthService.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
warply_android_sdk/src/main/res/values/strings.xml
warply_android_sdk/build.gradle
View file @
e9cc871
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta7
8
'
PUBLISH_VERSION
=
'4.5.4-cosbeta7
9
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/CouponShareActivity.java
View file @
e9cc871
...
...
@@ -26,6 +26,8 @@ import org.json.JSONArray;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
import
io.github.inflationx.viewpump.ViewPumpContextWrapper
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.io.callbacks.CallbackReceiver
;
...
...
@@ -61,7 +63,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
private
String
mSender
=
""
;
private
EditText
mEdtReceiver
;
private
AlertDialog
mAlertDialogSuccessSharing
,
mAlertDialogErrorSharing
,
mAlertDialogCouponAskSharing
,
mAlertDialogWrongNumberSharing
,
mAlertDialogNoAssets
;
mAlertDialogCouponAskSharing
,
mAlertDialogWrongNumberSharing
,
mAlertDialogNoAssets
;
private
boolean
mIsFromWallet
=
false
;
// ===========================================================
...
...
@@ -107,12 +109,24 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
ll_share_view
)
{
if
(
mConsumer
==
null
)
return
;
try
{
JSONObject
profMeta
=
new
JSONObject
(
mConsumer
.
getProfileMetadata
());
if
(
profMeta
!=
null
)
{
JSONArray
msisdnList
=
new
JSONArray
();
msisdnList
=
profMeta
.
optJSONArray
(
MSISDN_LIST
);
if
(
msisdnList
==
null
||
msisdnList
.
length
()
==
0
)
{
ArrayList
<
String
>
listdata
=
new
ArrayList
<
String
>();
if
(
msisdnList
!=
null
)
{
for
(
int
i
=
0
;
i
<
msisdnList
.
length
();
i
++)
{
if
(!
TextUtils
.
isEmpty
(
msisdnList
.
optString
(
i
).
trim
()))
listdata
.
add
(
msisdnList
.
optString
(
i
).
trim
());
}
}
if
(
listdata
==
null
||
listdata
.
size
()
==
0
)
{
showNoAssetsDialog
();
return
;
}
...
...
@@ -125,7 +139,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
ll_share_button
)
{
if
(!
TextUtils
.
isEmpty
(
mSender
)
&&
!
mTvPhoneHeader
.
getText
().
toString
().
equals
(
R
.
string
.
cos_coupon_share_sender
))
{
if
(!
TextUtils
.
isEmpty
(
mSender
)
&&
!
mTvPhoneHeader
.
getText
().
toString
().
equals
(
R
.
string
.
cos_coupon_share_sender
)
&&
!
TextUtils
.
isEmpty
(
mEdtReceiver
.
getText
().
toString
())
)
{
askSharingDialog
();
}
else
{
errorSharingDialog2
();
...
...
@@ -240,7 +254,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
private
void
errorSharingDialog2
()
{
mAlertDialogErrorSharing
=
new
AlertDialog
.
Builder
(
this
)
.
setTitle
(
R
.
string
.
cos_dlg_error_title
)
.
setTitle
(
R
.
string
.
cos_dlg_error_title
2
)
.
setMessage
(
R
.
string
.
cos_dlg_error_subtitle2
)
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button2
,
(
dialogPositive
,
whichPositive
)
->
{
dialogPositive
.
dismiss
();
...
...
@@ -254,6 +268,7 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
.
setMessage
(
R
.
string
.
cos_share_no_assets
)
.
setPositiveButton
(
R
.
string
.
cos_dlg_positive_button2
,
(
dialogPositive
,
whichPositive
)
->
{
dialogPositive
.
dismiss
();
onBackPressed
();
})
.
show
();
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyAnalysisActivity.java
View file @
e9cc871
...
...
@@ -195,10 +195,12 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
sBuilderShared
.
setSpan
(
typefaceRegularSharedSpan
,
0
,
getString
(
R
.
string
.
cos_shared_gifts_tab
).
length
(),
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
sharedTab
.
setText
(
sBuilderShared
,
TextView
.
BufferType
.
SPANNABLE
);
String
badgeValue
=
String
.
format
(
"%.02f"
,
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
());
SpannableStringBuilder
sBuilder
=
new
SpannableStringBuilder
();
sBuilder
.
append
(
getString
(
R
.
string
.
cos_wallet_text3
))
.
append
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
())
))
.
append
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
))
.
append
(
getString
(
R
.
string
.
cos_wallet_text4
))
.
append
(
String
.
format
(
getString
(
R
.
string
.
cos_value2
),
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
())))
.
append
(
getString
(
R
.
string
.
cos_wallet_text5
));
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyWallet.java
View file @
e9cc871
...
...
@@ -361,12 +361,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
if
(
WarplyManagerHelper
.
getLoyaltyBadge
()
!=
null
)
{
if
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
()
>
0
)
{
mTvGiftsValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
())));
String
badgeValue
=
String
.
format
(
"%.02f"
,
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
());
mTvGiftsValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
));
SpannableStringBuilder
sBuilder
=
new
SpannableStringBuilder
();
sBuilder
.
append
(
getString
(
R
.
string
.
cos_wallet_text3
))
.
append
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
())
))
.
append
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
))
.
append
(
getString
(
R
.
string
.
cos_wallet_text4
))
.
append
(
String
.
format
(
getString
(
R
.
string
.
cos_value2
),
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
())))
.
append
(
getString
(
R
.
string
.
cos_wallet_text5
));
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/services/WarplyHealthService.java
View file @
e9cc871
...
...
@@ -57,7 +57,7 @@ public class WarplyHealthService extends Service implements SensorEventListener
private
final
int
ACCEL_RING_SIZE
=
50
;
private
final
int
VEL_RING_SIZE
=
10
;
// change this threshold according to your sensitivity preferences
private
final
float
STEP_THRESHOLD
=
5
0
f
;
// default 40, cosmote default 20
private
final
float
STEP_THRESHOLD
=
6
0
f
;
// default 40, cosmote default 20
private
final
int
STEP_DELAY_NS
=
250000000
;
private
int
accelRingCounter
=
0
;
private
float
[]
accelRingX
=
new
float
[
ACCEL_RING_SIZE
];
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
e9cc871
...
...
@@ -1421,45 +1421,45 @@ public class WarplyManager {
}
if
(
camp
.
getOfferCategory
().
equals
(
"questionnaire"
))
{
if
(
WarplyManagerHelper
.
getConsumerInternal
()
!=
null
)
{
JSONObject
profMetadata
=
WarpJSONParser
.
getJSONFromString
(
WarplyManagerHelper
.
getConsumerInternal
().
getProfileMetadata
());
if
(
profMetadata
!=
null
)
{
if
(!
profMetadata
.
has
(
"answered"
))
{
try
{
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
if
(
extraFields
!=
null
)
{
if
(
extraFields
.
length
()
==
0
||
!(
extraFields
.
has
(
"ccms_offer"
)
||
extraFields
.
has
(
"type"
)))
{
campaignLoyaltyList
.
add
(
camp
);
}
}
}
catch
(
Exception
exception
)
{
campaignLoyaltyList
.
add
(
camp
);
}
}
}
else
{
try
{
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
if
(
extraFields
!=
null
)
{
if
(
extraFields
.
length
()
==
0
||
!(
extraFields
.
has
(
"ccms_offer"
)
||
extraFields
.
has
(
"type"
)))
{
campaignLoyaltyList
.
add
(
camp
);
}
}
}
catch
(
Exception
exception
)
{
campaignLoyaltyList
.
add
(
camp
);
}
}
}
else
{
try
{
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
if
(
extraFields
!=
null
)
{
if
(
extraFields
.
length
()
==
0
||
!(
extraFields
.
has
(
"ccms_offer"
)
||
extraFields
.
has
(
"type"
)))
{
campaignLoyaltyList
.
add
(
camp
);
}
}
}
catch
(
Exception
exception
)
{
campaignLoyaltyList
.
add
(
camp
);
}
}
//
if (WarplyManagerHelper.getConsumerInternal() != null) {
//
JSONObject profMetadata = WarpJSONParser.getJSONFromString(WarplyManagerHelper.getConsumerInternal().getProfileMetadata());
//
if (profMetadata != null) {
//
if (!profMetadata.has("answered")) {
//
try {
//
JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields());
//
if (extraFields != null) {
//
if (extraFields.length() == 0 || !(extraFields.has("ccms_offer") || extraFields.has("type"))) {
//
campaignLoyaltyList.add(camp);
//
}
//
}
//
} catch (Exception exception) {
//
campaignLoyaltyList.add(camp);
//
}
//
}
//
} else {
//
try {
//
JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields());
//
if (extraFields != null) {
//
if (extraFields.length() == 0 || !(extraFields.has("ccms_offer") || extraFields.has("type"))) {
//
campaignLoyaltyList.add(camp);
//
}
//
}
//
} catch (Exception exception) {
//
campaignLoyaltyList.add(camp);
//
}
//
}
//
} else {
//
try {
//
JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields());
//
if (extraFields != null) {
//
if (extraFields.length() == 0 || !(extraFields.has("ccms_offer") || extraFields.has("type"))) {
//
campaignLoyaltyList.add(camp);
//
}
//
}
//
} catch (Exception exception) {
//
campaignLoyaltyList.add(camp);
//
}
//
}
}
else
{
try
{
JSONObject
extraFields
=
WarpJSONParser
.
getJSONFromString
(
camp
.
getExtraFields
());
...
...
warply_android_sdk/src/main/res/values/strings.xml
View file @
e9cc871
...
...
@@ -39,6 +39,7 @@
<string
name=
"cos_redeem_coupon"
>
Απόκτησέ το
</string>
<string
name=
"cos_dlg_success_subtitle"
>
Το κουπόνι εξαργυρώθηκε με επιτυχία
</string>
<string
name=
"cos_dlg_error_title"
>
Αποτυχία
</string>
<string
name=
"cos_dlg_error_title2"
>
Αποτυχία αποστολής
</string>
<string
name=
"cos_dlg_return_title"
>
Επιστροφή δώρου
</string>
<string
name=
"cos_dlg_error_subtitle"
>
Κάτι πήγε στραβά
</string>
<string
name=
"cos_dlg_error_subtitle_non_buyable"
>
Το κουπόνι δεν είναι διαθέσιμο για αγορά
</string>
...
...
@@ -102,7 +103,7 @@
<string
name=
"cos_dlg_positive_coupon_title"
>
Κάνε δώρο
</string>
<string
name=
"cos_dlg_positive_coupon_subtitle"
>
Είσαι σίγουρος /-ή ότι θέλεις να κάνεις δώρο το κουπόνι σου;
</string>
<string
name=
"cos_dlg_negative_button3"
>
Αποστολή
</string>
<string
name=
"cos_dlg_error_subtitle2"
>
Τα πεδία δεν είναι σωστά
</string>
<string
name=
"cos_dlg_error_subtitle2"
>
Παρακαλούμε συμπλήρωσε σωστά τα πεδία.
</string>
<string
name=
"cos_dlg_success_couponset_title"
>
Επιτυχής ενεργοποίηση
</string>
<string
name=
"cos_dlg_success_couponset_subtitle"
>
Το κουπόνι σου έχει ενεργοποιηθεί στην ενότητα My Rewards.
</string>
<string
name=
"cos_dlg_activate_telco_title"
>
Ενεργοποίηση υπηρεσίας
</string>
...
...
Please
register
or
login
to post a comment