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-03-08 18:11:09 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e551ed955f43d765ae12112361ba63e22e4c6193
e551ed95
1 parent
6caa089c
sm deals history fixes
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
28 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyHistoryActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyMarketAnalysisActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyHistoryActivity.java
View file @
e551ed9
...
...
@@ -204,27 +204,22 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
countValue
=
0.0f
;
if
(
WarplyManagerHelper
.
getCouponRedeemedList
().
size
()
>
0
)
{
if
(
WarplyManagerHelper
.
getCouponsetsDeals
().
size
()
>
0
)
{
for
(
Couponset
couset
:
WarplyManagerHelper
.
getCouponsetsDeals
())
{
for
(
Coupon
cou
:
WarplyManagerHelper
.
getCouponRedeemedList
())
{
if
(
cou
.
getCouponsetUuid
().
equals
(
couset
.
getUuid
()))
{
countValue
+=
Float
.
parseFloat
(
cou
.
getDiscount
());
cou
.
setDescription
(
couset
.
getShortDescription
());
cou
.
setImage
(
couset
.
getImgPreview
());
cou
.
setName
(
couset
.
getName
());
cou
.
setMerchantUuid
(
couset
.
getMerchantUuid
());
cou
.
setInnerText
(
couset
.
getInnerText
());
cou
.
setDiscount_type
(
couset
.
getDiscount_type
());
cou
.
setFinal_price
(
couset
.
getFinal_price
());
break
;
}
}
for
(
Coupon
cou
:
WarplyManagerHelper
.
getCouponRedeemedList
())
{
if
(
cou
.
getCouponsetDetails
().
getCouponsetType
().
equals
(
"supermarket"
))
{
countValue
+=
Float
.
parseFloat
(
cou
.
getDiscount
());
cou
.
setDescription
(
cou
.
getCouponsetDetails
().
getShortDescription
());
cou
.
setImage
(
cou
.
getCouponsetDetails
().
getImgPreview
());
cou
.
setName
(
cou
.
getCouponsetDetails
().
getName
());
cou
.
setMerchantUuid
(
cou
.
getCouponsetDetails
().
getMerchantUuid
());
cou
.
setInnerText
(
cou
.
getCouponsetDetails
().
getInnerText
());
cou
.
setDiscount_type
(
cou
.
getCouponsetDetails
().
getDiscount_type
());
cou
.
setFinal_price
(
cou
.
getCouponsetDetails
().
getFinal_price
());
}
}
}
mFavValue
+=
countValue
;
String
badgeValue
=
String
.
format
(
Locale
.
GERMAN
,
"%.02f"
,
countValue
);
String
badgeValue
=
String
.
format
(
Locale
.
GERMAN
,
"%.02f"
,
countValue
);
mTvMarketValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
));
if
(
String
.
valueOf
(
countValue
).
length
()
>=
3
)
{
mTvMarketValue
.
setTextSize
(
12
);
...
...
@@ -237,7 +232,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
sBuilderThird
.
setSpan
(
typefaceBoldSpanThird
,
24
,
24
+
badgeValue
.
length
()
+
1
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
);
mTvMarketAll
.
setText
(
sBuilderThird
,
TextView
.
BufferType
.
SPANNABLE
);
}
else
{
String
badgeValue
=
String
.
format
(
Locale
.
GERMAN
,
"%.02f"
,
0.0f
);
String
badgeValue
=
String
.
format
(
Locale
.
GERMAN
,
"%.02f"
,
0.0f
);
mTvMarketValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
));
SpannableStringBuilder
sBuilderThird
=
new
SpannableStringBuilder
();
sBuilderThird
.
append
(
String
.
format
(
getString
(
R
.
string
.
cos_supermarket_win
),
badgeValue
));
...
...
@@ -249,7 +244,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
/** Third Banner */
if
(
WarplyManagerHelper
.
getLoyaltyBadge
()
!=
null
&&
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
()
>
0
||
WarplyManagerHelper
.
getLoyaltyBadge
().
getCouponCount
()
==
0
))
{
String
badgeValue
=
String
.
format
(
Locale
.
GERMAN
,
"%.02f"
,
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
());
String
badgeValue
=
String
.
format
(
Locale
.
GERMAN
,
"%.02f"
,
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
());
mTvGiftsValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
badgeValue
));
if
(
String
.
valueOf
(
WarplyManagerHelper
.
getLoyaltyBadge
().
getValue
()).
length
()
>=
3
)
{
mTvGiftsValue
.
setTextSize
(
12
);
...
...
@@ -266,7 +261,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
/** Third Banner */
/** Sum Banner */
String
allValue
=
String
.
format
(
Locale
.
GERMAN
,
"%.02f"
,
mFavValue
);
String
allValue
=
String
.
format
(
Locale
.
GERMAN
,
"%.02f"
,
mFavValue
);
mTvFavValue
.
setText
(
String
.
format
(
getString
(
R
.
string
.
cos_value
),
allValue
));
/** Sum Banner */
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/LoyaltyMarketAnalysisActivity.java
View file @
e551ed9
...
...
@@ -104,15 +104,10 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl
// }
if
(
WarplyManagerHelper
.
getCouponRedeemedList
().
size
()
>
0
)
{
if
(
WarplyManagerHelper
.
getCouponsetsDeals
().
size
()
>
0
)
{
for
(
Couponset
couset
:
WarplyManagerHelper
.
getCouponsetsDeals
())
{
for
(
Coupon
cou
:
WarplyManagerHelper
.
getCouponRedeemedList
())
{
if
(
cou
.
getCouponsetUuid
().
equals
(
couset
.
getUuid
()))
{
countValue
+=
Float
.
valueOf
(
cou
.
getDiscount
());
mExpiredMarketCoupons
.
add
(
cou
);
break
;
}
}
for
(
Coupon
cou
:
WarplyManagerHelper
.
getCouponRedeemedList
())
{
if
(
cou
.
getCouponsetDetails
().
getCouponsetType
().
equals
(
"supermarket"
))
{
countValue
+=
Float
.
valueOf
(
cou
.
getDiscount
());
mExpiredMarketCoupons
.
add
(
cou
);
}
}
}
...
...
Please
register
or
login
to post a comment